dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
688 stars 160 forks source link

Await cmd() doesn't work #590

Closed ZoomGC closed 11 months ago

ZoomGC commented 11 months ago

Summary

When running 'await cmd(channel = chnl)' it doesn't work

Reproduction Steps

Defined my channel as chnl = channel Defined the command and ensure both are truly correct and defined through the use of print statements Use the discussion page to see `await command(channel=)' is correct Try to use it in your code It doesn't work

Code

async def bump332(ctx):
        print("bump")
        global guild; global chnl; global randTime
        async for cmd in ctx.channel.slash_commands(command_ids=[947088344167366698]):
                print(cmd.name)
                if cmd.name == "test":
                        print(cmd)
                        await cmd(channel = chnl)

Expected Results

The command runs

Actual Results

The command doesn't work, doesn't throw an exception/error, the command just isn't processed

System Information

Checklist

Additional Information

No response

Asleep123 commented 11 months ago

what exactly is the error, and what is the code for your "cmd" function? please enclose it in three backticks (```)

ZoomGC commented 11 months ago

The issue was putting “channel = chnl” in my parentheses, it should just be “cmd(chnl)”, and the “cmd” function is literally part of the “slash_command” object as shown in the code, it isn’t a function I wrote, please read the code in the issues you respond to :)