Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: all ID from int to int64 to avoid 32bits machine break (#2191)
Athurg Gooth9987337eca9e
diff --git a/plugin/telegram/api_edit_message.go b/plugin/telegram/api_edit_message.goindex 798518b67..2345d9b79 100644--- a/plugin/telegram/api_edit_message.go+++ b/plugin/telegram/api_edit_message.go@@ -9,10 +9,10 @@ import ()// EditMessage make an editMessageText api request.-func (b *Bot) EditMessage(ctx context.Context, chatID, messageID int, text string, inlineKeyboards [][]InlineKeyboardButton) (*Message, error) {+func (b *Bot) EditMessage(ctx context.Context, chatID, messageID int64, text string, inlineKeyboards [][]InlineKeyboardButton) (*Message, error) {formData := url.Values{- "message_id": {strconv.Itoa(messageID)},- "chat_id": {strconv.Itoa(chatID)},+ "message_id": {strconv.FormatInt(messageID, 10)},+ "chat_id": {strconv.FormatInt(chatID, 10)},"text": {text},}diff --git a/plugin/telegram/api_get_updates.go b/plugin/telegram/api_get_updates.goindex c1fcd58ad..40948805e 100644--- a/plugin/telegram/api_get_updates.go+++ b/plugin/telegram/api_get_updates.go@@ -7,10 +7,10 @@ import ()// GetUpdates make a getUpdates api request.-func (b *Bot) GetUpdates(ctx context.Context, offset int) ([]Update, error) {+func (b *Bot) GetUpdates(ctx context.Context, offset int64) ([]Update, error) {formData := url.Values{"timeout": {"60"},- "offset": {strconv.Itoa(offset)},+ "offset": {strconv.FormatInt(offset, 10)},}var result []Updatediff --git a/plugin/telegram/api_send_message.go b/plugin/telegram/api_send_message.goindex c081e3128..b53f9115f 100644--- a/plugin/telegram/api_send_message.go+++ b/plugin/telegram/api_send_message.go@@ -7,10 +7,10 @@ import ()// SendReplyMessage make a sendMessage api request.-func (b *Bot) SendReplyMessage(ctx context.Context, chatID, replyID int, text string) (*Message, error) {+func (b *Bot) SendReplyMessage(ctx context.Context, chatID, replyID int64, text string) (*Message, error) {formData := url.Values{- "reply_to_message_id": {strconv.Itoa(replyID)},- "chat_id": {strconv.Itoa(chatID)},+ "reply_to_message_id": {strconv.FormatInt(replyID, 10)},+ "chat_id": {strconv.FormatInt(chatID, 10)},"text": {text},}diff --git a/plugin/telegram/bot.go b/plugin/telegram/bot.goindex 953c44a13..23454e470 100644--- a/plugin/telegram/bot.go+++ b/plugin/telegram/bot.go@@ -31,7 +31,7 @@ const errRetryWait = 10 * time.Second// Start start a long polling using getUpdates to get Update, call r.MessageHandle while get new message updates.func (b *Bot) Start(ctx context.Context) {- var offset int+ var offset int64for {updates, err := b.GetUpdates(ctx, offset)diff --git a/plugin/telegram/chat.go b/plugin/telegram/chat.goindex c6c31d2d6..d8f2e1003 100644--- a/plugin/telegram/chat.go+++ b/plugin/telegram/chat.go@@ -10,7 +10,7 @@ const ()type Chat struct {- ID int `json:"id"`+ ID int64 `json:"id"`Title string `json:"title"` // Title for supergroups, channels and group chatsType ChatType `json:"type"` // Type of chat, can be either “private”, “group”, “supergroup” or “channel”FirstName string `json:"first_name"` // FirstName of the other party in a private chatdiff --git a/plugin/telegram/message.go b/plugin/telegram/message.goindex 6ed0bb89b..d4f9b7fcf 100644--- a/plugin/telegram/message.go+++ b/plugin/telegram/message.go@@ -3,13 +3,13 @@ package telegramimport "fmt"type Message struct {- MessageID int `json:"message_id"` // MessageID is a unique message identifier inside this chat+ MessageID int64 `json:"message_id"` // MessageID is a unique message identifier inside this chatFrom User `json:"from"` // From is a sender, empty for messages sent to channels;Date int `json:"date"` // Date of the message was sent in Unix timeText *string `json:"text"` // Text is for text messages, the actual UTF-8 text of the message, 0-4096 characters;Chat *Chat `json:"chat"` // Chat is the conversation the message belongs toForwardFromChat *Chat `json:"forward_from_chat"` // ForwardFromChat for messages forwarded from channels, information about the original channel;- ForwardFromMessageID int `json:"forward_from_message_id"` // ForwardFromMessageID for messages forwarded from channels, identifier of the original message in the channel;+ ForwardFromMessageID int64 `json:"forward_from_message_id"` // ForwardFromMessageID for messages forwarded from channels, identifier of the original message in the channel;MediaGroupID *string `json:"media_group_id"` // MediaGroupID is the unique identifier of a media message group this message belongs to;Photo []PhotoSize `json:"photo"` // Photo message is a photo, available sizes of the photo;Caption *string `json:"caption"` // Caption for the animation, audio, document, photo, video or voice, 0-1024 characters;diff --git a/plugin/telegram/update.go b/plugin/telegram/update.goindex 87cea9a91..e5cc1e524 100644--- a/plugin/telegram/update.go+++ b/plugin/telegram/update.go@@ -1,7 +1,7 @@package telegramtype Update struct {- UpdateID int `json:"update_id"`+ UpdateID int64 `json:"update_id"`Message *Message `json:"message"`CallbackQuery *CallbackQuery `json:"callback_query"`}diff --git a/plugin/telegram/user.go b/plugin/telegram/user.goindex fc4f58645..77a28887c 100644--- a/plugin/telegram/user.go+++ b/plugin/telegram/user.go@@ -1,5 +1,5 @@package telegramtype User struct {- ID int `json:"id"`+ ID int64 `json:"id"`}diff --git a/server/telegram.go b/server/telegram.goindex 7c4ee3c16..302243f2b 100644--- a/server/telegram.go+++ b/server/telegram.go@@ -50,7 +50,7 @@ func (t *telegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot,continue}- if value == strconv.Itoa(message.From.ID) {+ if value == strconv.FormatInt(message.From.ID, 10) {creatorID = userSetting.UserID}}