From 3beddeb22ff60cfbace496981642d4b926df41c2 Mon Sep 17 00:00:00 2001 From: Kurd <7689609+Alexkurd@users.noreply.github.com> Date: Sun, 18 Feb 2024 18:28:49 +0300 Subject: [PATCH 1/2] Fix Chat permissions mapping --- types.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/types.go b/types.go index d3e88ee..44cd681 100644 --- a/types.go +++ b/types.go @@ -2431,32 +2431,32 @@ type ChatMember struct { // True, if the user is allowed to send audios // // optional - CanSendAudios bool + CanSendAudios bool `json:"can_send_audios,omitempty"` // CanSendDocuments restricted only. // True, if the user is allowed to send documents // // optional - CanSendDocuments bool + CanSendDocuments bool `json:"can_send_documents,omitempty"` // CanSendPhotos is restricted only. // True, if the user is allowed to send photos // // optional - CanSendPhotos bool + CanSendPhotos bool `json:"can_send_photos,omitempty"` // CanSendVideos restricted only. // True, if the user is allowed to send videos // // optional - CanSendVideos bool + CanSendVideos bool `json:"can_send_videos,omitempty"` // CanSendVideoNotes restricted only. // True, if the user is allowed to send video notes // // optional - CanSendVideoNotes bool + CanSendVideoNotes bool `json:"can_send_video_notes,omitempty"` // CanSendVoiceNotes restricted only. // True, if the user is allowed to send voice notes // // optional - CanSendVoiceNotes bool + CanSendVoiceNotes bool `json:"can_send_voice_notes,omitempty"` // CanSendPolls restricted only. // True, if the user is allowed to send polls // @@ -2563,27 +2563,27 @@ type ChatPermissions struct { // CanSendAudios is true, if the user is allowed to send audios // // optional - CanSendAudios bool + CanSendAudios bool `json:"can_send_audios,omitempty"` // CanSendDocuments is true, if the user is allowed to send documents // // optional - CanSendDocuments bool + CanSendDocuments bool `json:"can_send_documents,omitempty"` // CanSendPhotos is true, if the user is allowed to send photos // // optional - CanSendPhotos bool + CanSendPhotos bool `json:"can_send_photos,omitempty"` // CanSendVideos is true, if the user is allowed to send videos // // optional - CanSendVideos bool + CanSendVideos bool `json:"can_send_videos,omitempty"` // CanSendVideoNotes is true, if the user is allowed to send video notes // // optional - CanSendVideoNotes bool + CanSendVideoNotes bool `json:"can_send_video_notes,omitempty"` // CanSendVoiceNotes is true, if the user is allowed to send voice notes // // optional - CanSendVoiceNotes bool + CanSendVoiceNotes bool `json:"can_send_voice_notes,omitempty"` // CanSendPolls is true, if the user is allowed to send polls, implies // can_send_messages // From a7a786d5aa211cb9758eb1dcf8b9b832d6dec896 Mon Sep 17 00:00:00 2001 From: dmekhov Date: Sun, 3 Mar 2024 18:27:18 +0300 Subject: [PATCH 2/2] fix ReplyToMessageID assignment in readme for compatibility with 7.0 api --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d57085..d61b42c 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ func main() { log.Printf("[%s] %s", update.Message.From.UserName, update.Message.Text) msg := tgbotapi.NewMessage(update.Message.Chat.ID, update.Message.Text) - msg.ReplyToMessageID = update.Message.MessageID + msg.ReplyParameters.MessageID = update.Message.MessageID bot.Send(msg) }