#Slash commands not working in class

1 messages · Page 1 of 1 (latest)

final sigil
#

So simply said, i have this slash in my class, but it asks for ctx parameter, when i removed it, it put ctx parameter into self

@discord.ext.commands.is_owner()
@option('collection', description='Choose database', choices=['Games', 'Site exceptions', 'exceptions'])
    async def add_to(self, ctx, collection: str, string: str):
        listing = self.retreive_list(collection)
        print(listing)```
#

Slash commands not working in class

stable monolith
final sigil
#

bot subclass

stable monolith
#

pretty sure @bot.slash_command wont work inside bot subclass. (not even in cogs for the matter of fact)

final sigil
#

so how do i make it work?

stable monolith
#

i would try @discord.slash_command() but high chance that wont work

undone marshBOT
#

discord/bot.py line 884

return self.application_command(cls=SlashCommand, **kwargs)```
stable monolith
#

or first, try smth like

def my_deco(self, **kwargs):
  return self.slash_command(**kwargs)

class MyBot(Bot):
  ...
  
  @my_deco
  async def some_cmd(self, ...):
    ...
#

||decorators are one part of the areas that trouble me a lot blobpain ||

final sigil
stable monolith
#

That is the easiest

#

Lol

final sigil
#

yep xd

stable monolith
#

Soo

#

.close

mortal mangoBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @undone marsh.