Skip to content

Commit

Permalink
Merge branch 'shardlab:main' into fix/group-subcommand-mixing
Browse files Browse the repository at this point in the history
  • Loading branch information
itsthedevman authored Mar 8, 2024
2 parents 3fc283e + edad88d commit ebb5e8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/ping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Here we output the invite URL to the console so the bot account can be invited to the channel. This only has to be
# done once, afterwards, you can remove this part if you want
puts "This bot's invite URL is #{bot.invite_url}."
puts "This bot's invite URL is #{bot.invite_url}"
puts 'Click on it to invite it to your server.'

# This method call adds an event handler that will be called on any message that exactly contains the string "Ping!".
Expand Down
4 changes: 2 additions & 2 deletions lib/discordrb/webhooks/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def button(style:, label: nil, emoji: nil, custom_id: nil, disabled: nil, url: n
when Integer, String
emoji.to_i.positive? ? { id: emoji } : { name: emoji }
else
emoji.to_h
emoji&.to_h
end

@components << { type: COMPONENT_TYPES[:button], label: label, emoji: emoji, style: style, custom_id: custom_id, disabled: disabled, url: url }
Expand Down Expand Up @@ -149,7 +149,7 @@ def option(label:, value:, description: nil, emoji: nil, default: nil)
when Integer, String
emoji.to_i.positive? ? { id: emoji } : { name: emoji }
else
emoji.to_h
emoji&.to_h
end

@options << { label: label, value: value, description: description, emoji: emoji, default: default }
Expand Down

0 comments on commit ebb5e8d

Please sign in to comment.