feat(controller): add source for command handling.

feat(telegram): switch message type to markdown
feat(controller): add welcome message for telegram bot.
This commit is contained in:
2026-08-13 17:07:55 +08:00
parent 8589654ba4
commit f2cc16177c
8 changed files with 90 additions and 65 deletions
@@ -169,10 +169,14 @@ func (t *TelegramController) processCommand(cmd controller.Command) string {
parsed.ChatID = cmd.ChatID
parsed.ChatType = cmd.ChatType
parsed.SenderID = cmd.SenderID
parsed.Source = "telegram"
// Hand the complete command to the unified processor, which checks group
// vs private, trusted groups, admin permissions, and executes it.
response, err := controller.GetManager().Trigger(parsed, t.cfg.TrustedGroups, t.resolvedAdminList(), t.cfg.ListenMethod)
if config.GetConfig().System.DebugMode && config.GetConfig().Debug.ShowTriggerCmdEcho {
postLog.Debug(fmt.Sprintf("[telegram] triggered command: \"/%s\" with args: \"%s\" from chatID: %d and senderID: %d", parsed.Command, strings.Join(parsed.Args, ", "), cmd.ChatID, cmd.SenderID))
}
if err != nil {
postLog.Error("Telegram command processing failed: " + err.Error())
return ""