mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-18 03:37:33 +08:00
fix bug
This commit is contained in:
@@ -172,9 +172,6 @@ func (c *TelegramChannel) handleMessage(message *telego.Message) {
|
||||
}
|
||||
|
||||
senderID := fmt.Sprintf("%d", user.ID)
|
||||
if user.Username != "" {
|
||||
senderID = fmt.Sprintf("%d|%s", user.ID, user.Username)
|
||||
}
|
||||
|
||||
chatID := message.Chat.ID
|
||||
c.chatIDs[senderID] = chatID
|
||||
@@ -262,6 +259,11 @@ func (c *TelegramChannel) handleMessage(message *telego.Message) {
|
||||
|
||||
log.Printf("Telegram message from %s: %s...", senderID, truncateString(content, 50))
|
||||
|
||||
if !c.IsAllowed(senderID) {
|
||||
log.Printf("Telegram message rejected by allowlist: sender=%s chat=%d", senderID, chatID)
|
||||
return
|
||||
}
|
||||
|
||||
// Thinking indicator
|
||||
_ = c.bot.SendChatAction(context.Background(), &telego.SendChatActionParams{
|
||||
ChatID: telegoutil.ID(chatID),
|
||||
|
||||
Reference in New Issue
Block a user