Skip to content

Commit

Permalink
readding /r command
Browse files Browse the repository at this point in the history
Back by popular demand due to discord terrible permission system with
slash commands and channels, I am readding /r command
  • Loading branch information
Humblemonk committed Oct 18, 2023
1 parent 01996f2 commit 8792080
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ On August 31st 2022, Discord is enforcing new permission rules for large bots. T
In an attempt to not have to rewrite the majority of Dice Maidens codebase, I applied for privileged intents and was denied. The Discord devteam recommended moving the bot to slash commands so here we are. What this means for users:

* !roll and other prefixes have been retired. Sorry no custom prefixes
* rolls can be initiated now by doing /roll
* rolls can be initiated now by doing /roll or /r
* Some new (and maybe old) bugs might crop up with this shift to slash command. We are working on ironing these out
* Bot permissions may have broken for your server. Please update the permission for the bot or re add the bot to your server

Expand Down
10 changes: 10 additions & 0 deletions dice_maiden.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@
@bot.register_application_command(:roll, 'Ask Dice Maiden to roll some dice!') do |cmd|
cmd.string('message', 'roll syntax sent to Dice Maiden. Type help or visit github to view possible commands', required: true)
end

@bot.register_application_command(:r, 'Ask Dice Maiden to roll some dice!') do |cmd|
cmd.string('message', 'roll syntax sent to Dice Maiden. Type help or visit github to view possible commands', required: true)
end

#log the command id for the above commands
@bot.get_application_commands.map(&:id).each do |id|
puts id
end
end

inc_cmd = lambda do |event|
Expand Down Expand Up @@ -170,6 +179,7 @@
end

@bot.application_command(:roll, &inc_cmd)
@bot.application_command(:r, &inc_cmd)

if @launch_option == 'lite'
@bot.run
Expand Down

0 comments on commit 8792080

Please sign in to comment.