Skip to content

Commit

Permalink
feat: set default menu button
Browse files Browse the repository at this point in the history
  • Loading branch information
alariczq authored and demget committed Aug 9, 2024
1 parent e8d6ed9 commit b19cf78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,11 @@ func (b *Bot) MenuButton(chat *User) (*MenuButton, error) {
// - MenuButtonType for simple menu buttons (default, commands)
// - MenuButton complete structure for web_app menu button type
func (b *Bot) SetMenuButton(chat *User, mb interface{}) error {
params := map[string]interface{}{
"chat_id": chat.Recipient(),
params := map[string]interface{}{}

// chat_id is optional
if chat != nil {
params["chat_id"] = chat.Recipient()
}

switch v := mb.(type) {
Expand Down

0 comments on commit b19cf78

Please sign in to comment.