Skip to content

Commit

Permalink
Update slash commands example to include name and description localiz…
Browse files Browse the repository at this point in the history
…ations.
  • Loading branch information
expeehaa committed Nov 26, 2023
1 parent 9adea0c commit e3635c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/slash_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#
# You may want to have a separate script for registering your commands so you don't need to do this every
# time you start your bot.
bot.register_application_command(:example, 'Example commands', server_id: ENV.fetch('SLASH_COMMAND_BOT_SERVER_ID', nil)) do |cmd|
bot.register_application_command(:example, 'Example commands', server_id: ENV.fetch('SLASH_COMMAND_BOT_SERVER_ID', nil), name_localizations: { 'de' => 'beispiel' }, description_localizations: { 'de' => 'Beispielbefehle' }) do |cmd|
cmd.subcommand_group(:fun, 'Fun things!') do |group|
group.subcommand('8ball', 'Shake the magic 8 ball') do |sub|
sub.string('question', 'Ask a question to receive wisdom', required: true)
sub.string('question', 'Ask a question to receive wisdom', required: true, name_localizations: { 'de' => 'frage' }, description_localizations: { 'de' => 'Stell eine Frage um Weisheit zu erlangen' })
end

group.subcommand('java', 'What if it was java?')
Expand Down

0 comments on commit e3635c6

Please sign in to comment.