shardlab / discordrb

Discord API for Ruby
MIT License
538 stars 99 forks source link

[ QUESTION ] Discordrb::Commands::CommandBot.new VS Discordrb::Bot.new #278

Closed viniciusborgeis closed 1 month ago

viniciusborgeis commented 1 month ago

Hello everyone, I have a simple question. In the docs, I see that Discordrb::Commands::CommandBot.new seems simpler than Discordrb::Bot.new for creating commands. However, I'm not sure what I'm missing out on when choosing Discordrb::Commands::CommandBot.new instead of a 'normal' Discordrb::Bot.new . In my case, my bot needs to handle events like messages, joining the server, clicking buttons, and more. At the same time, I also need to create slash commands and other types of commands. If I choose to instantiate a Discordrb::Commands::CommandBot.new, can I still work with these events? If that's not the case, what can I do to handle both events and slash commands?"

swarley commented 1 month ago

CommandBot is a super set of Bot with additional methods for a default command handling configuration. Everything that a Bot class can do is also supported by CommandBot