Added Slash Command Support#24
Open
NeilShah2026 wants to merge 1 commit into
Open
Conversation
When you use the `command_run` on the `on_slash_command` event, it does not work, as slash commands to not register their name in that format, the new function, `slash_command_start` will fix that.
Author
|
Why do you create a new method instead of having a parameter in the My suggestion would be: def command_run(self, ctx: Context, slash: bool=False) -> None:
self.commands += 1
if ctx.author.id not in self.active:
self.active.append(ctx.author.id)
command = ctx.command.name if not slash else ctx.nameAnd second, for which Library is this support? There is no official support from discord.py because it isn't maintained anymore and didn't get to this state in the alpha. It doesn't make sense to add support for an external library that only a few people use. This feature should be implemented when there is a good fork that is in a Release state, which is popular and is used by most Python Developers. |
Author
|
Sorry, forgot to close it, it used to work a few months ago with discord-py-slash-command.
… On Jan 1, 2022, at 4:40 PM, Niklas ***@***.***> wrote:
Why do you create a new method instead of having a parameter in the command_run function?
My suggestion would be:
def command_run(self, ctx: Context, slash: bool=False) -> None:
self.commands += 1
if ctx.author.id not in self.active:
self.active.append(ctx.author.id)
command = ctx.command.name if not slash else ctx.name
And second, for which Library is this support? There is no official support from discord.py, because it isn't maintained anymore and didn't get to this state in the alpha. It doesn't make sense to add support for a external library which only a few people use. This feature should be implemented when there is a good fork which is in a Release state, which is popular and is used by most Python Developers.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Member
|
@NeilShah2026 With the resurgence of discord.py, we're more than happy to review this once it's fixed to work with the official Discord.py library. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When you use the
command_runon theon_slash_commandevent, it does not work, as slash commands to not register their name in that format, the new function,slash_command_startwill fix that.