mirror of
https://github.com/tucnak/telebot
synced 2024-11-05 06:00:58 +00:00
chat: change User id type to int64
This commit is contained in:
parent
90abbce6dd
commit
8f725d434e
@ -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
|
||||
|
4
chat.go
4
chat.go
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user