Register commands manually
See original GitHub issueIs your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I’m always frustrated when […]
I’m deploying my discord bot in the cloud with multiple instances.
Somehow, I made a Redis-based command-ignoring logic so that not every instance handles one request.
The problem is that the current registerCommandOptions
only supports triggering RegisterCommandService
by discord message, so it is hard to suppress every instance registering new commands. This is especially problematic when the removeCommandsBefore
flag is on.
Describe the solution you’d like
- Expose
RegisterCommandService
in theDiscordModule
and let it trigger by manual (for example, HTTP request by admin, not with discord message such as!deploy
)
Describe alternatives you’ve considered if registerCommandOptions.allowFactory support Promise, I can add a ignore logic based on the caching layer(like Redis) so that I can trigger only one (not all of the instances)
Additional context nothing.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks for your quick support, @fjodor-rybakov !
I like the way you implemented it. nice.
See sample here https://github.com/fjodor-rybakov/discord-nestjs/tree/master/packages/sample/command-by-http-request