Merubokkusu / Discord-S.C.U.M

A Discord API Wrapper for Userbots/Selfbots written in Python.
MIT License
581 stars 170 forks source link

how to use slash with sub command and input? #477

Closed HentaiRyuu closed 6 months ago

HentaiRyuu commented 9 months ago

i need help on how to send this slash command /this_cmd get <input> and this is structure from print

    'name': 'this_cmd',
    'application_command': {
        'options': [{
            'type': 1,
            'name': 'get',
            'description': 'get',
            'options': [{
                'type': 3,
                'name': 'input',
                'description': 'Optional number'
            }]
        },

so i try it with

slashCmds = bot.getSlashCommands(botID).json()
from discum.utils.slash import SlashCommander
s = SlashCommander(slashCmds)

data = s.get(['this_cmd'], inputs={ 'input':100 })
# data = s.get(['this_cmd'], inputs={'get': [{'input':100}] })  # this also not working

bot.triggerSlashCommand(botID,channelID=channelID,guildID=guildID, data=data)

i have no idea how to get this works

just ref: https://github.com/Merubokkusu/Discord-S.C.U.M/blob/master/examples/slashcommands.py

rahaaatul commented 6 months ago

Try:

data = s.get(['this_cmd', 'get'], {'input':'100 '})
HentaiRyuu commented 6 months ago

Try:

data = s.get(['this_cmd', 'get'], {'input':'100 '})

thats worked, thank you very much.