Skip to content

Commit

Permalink
api: implement bot api 6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
nentenpizza authored and demget committed Feb 28, 2024
1 parent 4670ccf commit df250e6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
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"`
}

0 comments on commit df250e6

Please sign in to comment.