chat: change User id type to int64

This commit is contained in:
Demian 2021-07-27 15:12:10 +03:00
parent 90abbce6dd
commit 8f725d434e
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ var (
// required to test send and edit methods
token = os.Getenv("TELEBOT_SECRET")
chatID, _ = strconv.ParseInt(os.Getenv("CHAT_ID"), 10, 64)
userID, _ = strconv.Atoi(os.Getenv("USER_ID"))
userID, _ = strconv.ParseInt(os.Getenv("USER_ID"), 10, 64)
b, _ = newTestBot() // cached bot instance to avoid getMe method flooding
to = &Chat{ID: chatID} // to chat recipient for send and edit methods

View File

@ -4,7 +4,7 @@ import "strconv"
// User object represents a Telegram user, bot.
type User struct {
ID int `json:"id"`
ID int64 `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
@ -20,7 +20,7 @@ type User struct {
// Recipient returns user ID (see Recipient interface).
func (u *User) Recipient() string {
return strconv.Itoa(u.ID)
return strconv.FormatInt(u.ID, 10)
}
// Chat object represents a Telegram user, bot, group or a channel.