mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-12 20:15:42 +00:00
- Fix image_generation nil-pointer crash on codex agents: the sentinel now carries a name-only Function so the many sites reading td.Function.Name never nil-deref; codex_build still branches on Type. - Agent-declared trigger words in IDENTITY.md wake the bot in groups without an @mention (whole-word, Cyrillic-aware; text + caption), cached per-agent 60s. - channel_post support with a synthetic sender + a recover() guard so a malformed update can't crash the gateway. - message tool action=edit (editMessageText + editMessageCaption fallback), targeting the replied-to message via reply_to_message_id. - message tool topic=<name> posts into a named forum topic; topics learned from forum_topic_created into channel_contacts and resolved by name. Co-authored-by: skensel <skensel@MacBook-Pro-skensel.local> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
15 lines
503 B
Go
15 lines
503 B
Go
package telegram
|
|
|
|
import "testing"
|
|
|
|
// EditMessage must recognize the "no text to edit" error to fall back to caption editing.
|
|
func TestNoTextToEditRegex(t *testing.T) {
|
|
yes := `telego: editMessageText: api: 400 "Bad Request: there is no text in the message to edit"`
|
|
if !noTextToEditRe.MatchString(yes) {
|
|
t.Error("expected match for 'no text in the message to edit'")
|
|
}
|
|
if noTextToEditRe.MatchString("Bad Request: message can't be edited") {
|
|
t.Error("unrelated edit error must not match")
|
|
}
|
|
}
|