Skip to content

Commit

Permalink
Ensure Chat IDs are valid for Telegram supergroups.
Browse files Browse the repository at this point in the history
Syfaro committed Mar 30, 2016

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 23bef5d commit 4cb7934
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions telegram/telegram.go
Original file line number Diff line number Diff line change
@@ -5,16 +5,16 @@ import (
"log"
"strconv"

"github.com/Syfaro/telegram-bot-api"
"github.com/go-chat-bot/bot"
"gopkg.in/telegram-bot-api.v3"
)

var (
tg *tgbotapi.BotAPI
)

func responseHandler(target string, message string, sender *bot.User) {
id, err := strconv.Atoi(target)
id, err := strconv.ParseInt(target, 10, 64)
if err != nil {
log.Println(err)
return
@@ -51,7 +51,7 @@ func Run(token string, debug bool) {
b.Disable([]string{"url"})

for update := range updates {
target := strconv.Itoa(update.Message.Chat.ID)
target := strconv.FormatInt(update.Message.Chat.ID, 10)
sender := strconv.Itoa(update.Message.From.ID)
b.MessageReceived(target, update.Message.Text, &bot.User{Nick: sender})
}

0 comments on commit 4cb7934

Please sign in to comment.