guard non-send message actions by channel capability

This commit is contained in:
DBT
2026-02-24 09:14:43 +00:00
parent da862896e8
commit 3dd918d429
3 changed files with 29 additions and 0 deletions

View File

@@ -41,6 +41,15 @@ type TelegramChannel struct {
handleWG sync.WaitGroup
}
func (c *TelegramChannel) SupportsAction(action string) bool {
switch strings.ToLower(strings.TrimSpace(action)) {
case "", "send", "edit", "delete", "react":
return true
default:
return false
}
}
func NewTelegramChannel(cfg config.TelegramConfig, bus *bus.MessageBus) (*TelegramChannel, error) {
bot, err := telego.NewBot(cfg.Token, telego.WithDefaultLogger(false, false))
if err != nil {