kordlib / kordx.commands

Kotlin Command library for Kord and other APIs
MIT License
20 stars 3 forks source link

The bot function should not login itself to the gateway. #23

Open Animeshz opened 4 years ago

Animeshz commented 4 years ago

Description of problem

If the bot function logs itself in, the user won't be able to use any functionality from the CommandsProcessor. As such we can't get the list of commands, and the structure of the bot becomes inside-out (restricted to event handling).

One of the use-case of this (not automatically logging in) could be listen for MessageCreateEvent/MessageUpdateEvent and filter out the messages which does not contains the command in it. To filter this, one need reference to CommandsProcessor.commands and CommandsProcessor.prefix but it is impossible to do so with the bot function. (creating bot with BotBuilder manually instead of bot() function is an option, but it will create noise in the code).

Suggested Solution