From df250e64a20bf9f6bad900b22b10ab9e217e1252 Mon Sep 17 00:00:00 2001 From: Nikita Date: Sun, 25 Feb 2024 00:51:13 +0200 Subject: [PATCH] api: implement bot api 6.9 --- admin.go | 7 +++++++ admin_test.go | 3 +++ web_app.go | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/admin.go b/admin.go index cc8b33a..22b64c2 100644 --- a/admin.go +++ b/admin.go @@ -36,6 +36,10 @@ type Rights struct { CanSendVideoNotes bool `json:"can_send_video_notes"` CanSendVoiceNotes bool `json:"can_send_voice_notes"` + CanPostStories bool `json:"can_post_stories"` + CanEditStories bool `json:"can_edit_stories"` + CanDeleteStories bool `json:"can_delete_stories"` + // Independent defines whether the chat permissions are set independently. // If not, the can_send_other_messages and can_add_web_page_previews permissions // will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, @@ -106,6 +110,9 @@ func AdminRights() Rights { CanSendVideos: true, CanSendVideoNotes: true, CanSendVoiceNotes: true, + CanPostStories: true, + CanEditStories: true, + CanDeleteStories: true, } } diff --git a/admin_test.go b/admin_test.go index 886e794..16d27ea 100644 --- a/admin_test.go +++ b/admin_test.go @@ -40,6 +40,9 @@ func TestEmbedRights(t *testing.T) { "can_send_videos": true, "can_send_video_notes": true, "can_send_voice_notes": true, + "can_post_stories": false, + "can_edit_stories": false, + "can_delete_stories": false, } assert.Equal(t, expected, params) } diff --git a/web_app.go b/web_app.go index e5c9070..b0d3956 100644 --- a/web_app.go +++ b/web_app.go @@ -20,5 +20,7 @@ type WebAppData struct { // WebAppAccessAllowed represents a service message about a user allowing // a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. type WriteAccessAllowed struct { - WebAppName string `json:"web_app_name,omitempty"` + WebAppName string `json:"web_app_name,omitempty"` + FromRequest bool `json:"from_request,omitempty"` + FromAttachmentMenu bool `json:"from_attachment_menu,omitempty"` }