#My bot broke randomly
1 messages · Page 1 of 1 (latest)
Name = quest_number
And in the other u put pages
Name of the option need to be rue same as the other
I know
The decorator is not respected because the name is the wrong one
Replace the async def ctx, pages by ctx, quest_number
Show me the code
And also did u restart ur discord ?
it's input_type=int, not type
Its type I think
It is not.
hm
With one decorator is type
then thats just a bug
And not input_type
Use type=
If decorator is from discord
Can you do
@discord.option(
And you put ur thing
I told u
Why it’s not working
You just didn't even change it lol
The name of the parameter
Has to be the same has the other
Try that
@bot.slash_command(name="quest", description="View the current quests.")
@discord.option(name="quest_number", description="The number of the quest that you want to see.", type=int, min_value=1, max_value=6, required=False, default=1)
async def get(ctx, quest_number: int):
.......
@junior matrix did that work ?
What error ?
Show ur command code
But did the option was working ?
Code of the command
No but like rn
Does it was /quest and u have a dropdown
So the error was what I told u
Option name and the other need to be the same
Now the error is on the command code not option
?tag requests
Why you should not use the requests library for your bot
requests is a popular HTTP library for Python. It is however not a good option for Discord bots, since it is not async and blocking.
This essentially means that your bot will not be able to execute any code at all while a request is happening. Since requests usually take a few seconds to complete, this can have a detrimental effect on your bot's performance. E.g if a user executes a command that performs a request taking 5 seconds to complete, no one else will be able to use your bot for those 5 seconds.
Please look at using a HTTP library that has async support, such as aiohttp or httpx
Also, if you do an API request, always use await ctx.defer()
Also toothy option take type while Option take input_type
yea, i saw it, just a dumb change and a semantic bug imo
Nelo told me that it will add input_type also in the other
Still on the master ig
change the variable names...
you didnt change it in your code
if you change the parameter name you need to change it everywhere in your code too
Replace page by quest_number
With pleasure