mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-07 09:47:35 +08:00
add message edit/delete/react flow and incremental process poll logs
This commit is contained in:
@@ -532,11 +532,17 @@ func (c *TelegramChannel) handleAction(ctx context.Context, chatID int64, action
|
||||
defer cancel()
|
||||
return c.bot.DeleteMessage(delCtx, &telego.DeleteMessageParams{ChatID: telegoutil.ID(chatID), MessageID: messageID})
|
||||
case "react":
|
||||
reactCtx, cancel := withTelegramAPITimeout(ctx)
|
||||
defer cancel()
|
||||
emoji := strings.TrimSpace(msg.Emoji)
|
||||
if emoji == "" {
|
||||
return fmt.Errorf("emoji required for react action")
|
||||
}
|
||||
return fmt.Errorf("telegram react action not supported by current telego version")
|
||||
return c.bot.SetMessageReaction(reactCtx, &telego.SetMessageReactionParams{
|
||||
ChatID: telegoutil.ID(chatID),
|
||||
MessageID: messageID,
|
||||
Reaction: []telego.ReactionType{&telego.ReactionTypeEmoji{Emoji: emoji}},
|
||||
})
|
||||
default:
|
||||
return fmt.Errorf("unsupported telegram action: %s", action)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user