You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.
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
Change the bot function signature (not backward compatible):
/** * Creates a bot with the given [kord] instance, applying [configure] to the bot's configuration.*/suspendinlinefunbot(kord:Kord, configure:KordProcessorBuilder.() ->Unit): CommandProcessor=BotBuilder(kord).apply { processorBuilder.configure() }.build()
Doing this we can't assure the backward compatibility with the older function, but as this library wasn't stable and used much as of now we shall change the method signature.
Deprecate the current function and define new which can optionally login:
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
Change the bot function signature (not backward compatible):
Doing this we can't assure the backward compatibility with the older function, but as this library wasn't stable and used much as of now we shall change the method signature.
Deprecate the current function and define new which can optionally login:
The text was updated successfully, but these errors were encountered: