Skip to content

Commit

Permalink
Changed some field data types to int64 (#11)
Browse files Browse the repository at this point in the history
To fix crashes on 32-bit systems.
Also, it explicitly says so at https://core.telegram.org/bots/api
  • Loading branch information
dir01 authored Jan 13, 2023
1 parent 1d0067f commit eba8c31
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion models/animation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ type Animation struct {
Thumb *PhotoSize `json:"thumb,omitempty"`
FileName string `json:"file_name,omitempty"`
MimeType string `json:"mime_type,omitempty"`
FileSize int `json:"file_size,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
2 changes: 1 addition & 1 deletion models/audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ type Audio struct {
Title string `json:"title,omitempty"`
FileName string `json:"file_name,omitempty"`
MimeType string `json:"mime_type,omitempty"`
FileSize int `json:"file_size,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
Thumb *PhotoSize `json:"thumb,omitempty"`
}
4 changes: 2 additions & 2 deletions models/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type ChatLocation struct {

// Chat https://core.telegram.org/bots/api#chat
type Chat struct {
ID int `json:"id"`
ID int64 `json:"id"`
Type string `json:"type"`
Title string `json:"title,omitempty"`
Username string `json:"username,omitempty"`
Expand All @@ -93,6 +93,6 @@ type Chat struct {
HasProtectedContent bool `json:"has_protected_content,omitempty"`
StickerSetName string `json:"sticker_set_name,omitempty"`
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
LinkedChatID int `json:"linked_chat_id,omitempty"`
LinkedChatID int64 `json:"linked_chat_id,omitempty"`
Location *ChatLocation `json:"location,omitempty"`
}
2 changes: 1 addition & 1 deletion models/contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ type Contact struct {
PhoneNumber string `json:"phone_number"`
FirstName string `json:"first_name"`
LastName string `json:"last_name,omitempty"`
UserID int `json:"user_id,omitempty"`
UserID int64 `json:"user_id,omitempty"`
VCard string `json:"vcard,omitempty"`
}
2 changes: 1 addition & 1 deletion models/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ type Document struct {
Thumb *PhotoSize `json:"thumb,omitempty"`
FileName string `json:"file_name,omitempty"`
MimeType string `json:"mime_type,omitempty"`
FileSize int `json:"file_size,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
2 changes: 1 addition & 1 deletion models/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ package models
type File struct {
FileID string `json:"file_id"`
FileUniqueID string `json:"file_unique_id"`
FileSize int `json:"file_size,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
FilePath string `json:"file_path,omitempty"`
}
4 changes: 2 additions & 2 deletions models/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ type Message struct {
SupergroupChatCreated bool `json:"supergroup_chat_created,omitempty"`
ChannelChatCreated bool `json:"channel_chat_created,omitempty"`
MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"`
MigrateToChatID int `json:"migrate_to_chat_id,omitempty"`
MigrateFromChatID int `json:"migrate_from_chat_id,omitempty"`
MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`
MigrateFromChatID int64 `json:"migrate_from_chat_id,omitempty"`
PinnedMessage *Message `json:"pinned_message,omitempty"`
Invoice *Invoice `json:"invoice,omitempty"`
SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type UserProfilePhotos struct {

// User https://core.telegram.org/bots/api#user
type User struct {
ID int `json:"id"`
ID int64 `json:"id"`
IsBot bool `json:"is_bot"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion models/video.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ type Video struct {
Thumb *PhotoSize `json:"thumb,omitempty"`
FileName string `json:"file_name,omitempty"`
MimeType string `json:"mime_type,omitempty"`
FileSize int `json:"file_size,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
2 changes: 1 addition & 1 deletion models/voice.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ type Voice struct {
FileUniqueID string `json:"file_unique_id"`
Duration int `json:"duration"`
MimeType string `json:"mime_type,omitempty"`
FileSize int `json:"file_size,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}

0 comments on commit eba8c31

Please sign in to comment.