Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: implement bot api 6.9 #656

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -106,6 +110,9 @@ func AdminRights() Rights {
CanSendVideos: true,
CanSendVideoNotes: true,
CanSendVoiceNotes: true,
CanPostStories: true,
CanEditStories: true,
CanDeleteStories: true,
}
}

Expand Down
3 changes: 3 additions & 0 deletions admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
4 changes: 3 additions & 1 deletion web_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Loading