Skip to content

Commit

Permalink
Fix channel ID comparison in BotDo function
Browse files Browse the repository at this point in the history
  • Loading branch information
csznet committed Apr 18, 2024
1 parent e8885ce commit b41260b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func BotDo() {
newMsg := tgbotapi.NewMessage(msg.Chat.ID, strings.TrimSuffix(conf.BaseUrl, "/")+"/d/"+fileID)
newMsg.ReplyToMessageID = msg.MessageID
if !strings.HasPrefix(conf.ChannelName, "@") {
if man, err := strconv.Atoi(conf.ChannelName); err == nil && newMsg.ReplyToMessageID == man {
if man, err := strconv.Atoi(conf.ChannelName); err == nil && int(msg.Chat.ID) == man {
bot.Send(newMsg)
}
} else {
Expand Down

0 comments on commit b41260b

Please sign in to comment.