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 committed Jul 23, 2024
1 parent a8acf84 commit f359c52
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 @@ -1146,8 +1146,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 f359c52

Please sign in to comment.