You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My command gives me a permission error even if its not in the code.
Reproduction Steps
@commands.is_owner()@app_commands.user_install()@app_commands.allowed_contexts(guilds=True,dms=True,private_channels=True)@tree.command(name="admin",description="This is an admin command. No info will be given.")asyncdefadmin(interaction,id:int,arg1:str=None,arg2:str=None,bool:bool=None):
ifid==1:
ifnotarg1.startswith("<@"):
user=awaitclient.fetch_user(arg1)
profile=db.reference(f"/profiles/users/{arg1}")
profile.set({})
ifbool!=False:
awaituser.send("Hello! Your profile has been removed due to recent changes. You can always create it again with /menu")
response="ID: 1 - Remove user profile. Successful"awaitinteraction.response.send_message(f"{response}",ephemeral=True)
else:
awaitinteraction.response.send_message(f"arg1 must be an ID.",ephemeral=True)
elifid==2:
try:
ifarg1=='guild':
awaittree.sync(guild=discord.Object(id=<guildid>))
response="ID: 2 - Sync guild command tree. Successful"else:
response="ID: 2 - Sync global command tree. Successful"awaittree.sync()
exceptdiscord.HTTPException:
response="ID: 2 - Sync global command tree. Failed"awaitinteraction.response.send_message(f"{response}",ephemeral=True)
else:
response="Unknown ID."awaitinteraction.response.send_message(f"{response}",ephemeral=True)
Ran command /admin id:1 arg1:<someone's id> bool:True
Minimal Reproducible Code
No response
Expected Results
I expected that the command will output "ID: 1 - Remove user profile. Successful"
Actual Results
Console: No output
It sent a message saying "You don't have permissions to use this command."
Intents
all
System Information
Python v3.12.4-final
discord.py v2.4.0-final
aiohttp v3.9.5
system info: Windows 11 10.0.22631
Checklist
I have searched the open issues for duplicates.
I have shown the entire traceback, if possible.
I have removed my token from display, if visible.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
tjf1dev
changed the title
commands.is_owner You don't have permissions to use this command.
commands.is_owner You don't have permissions to use this command. (discord.py 2.4.0 final)
Jul 11, 2024
oh actually im running Linux 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 (on my vps)
tjf1dev
changed the title
commands.is_owner You don't have permissions to use this command. (discord.py 2.4.0 final)
You don't have permissions to use this command. (discord.py 2.4.0 final)
Jul 11, 2024
commands.is_owner() is not meant to be used with interactions. The library also doesn't have a string that says this, so this is some combination on your end that's triggering it. If you want to receive help for this you're going to need to provide more information, like a traceback or something. Either way, currently the code as given is not necessarily valid.
Summary
My command gives me a permission error even if its not in the code.
Reproduction Steps
Ran command /admin id:1 arg1:<someone's id> bool:True
Minimal Reproducible Code
No response
Expected Results
I expected that the command will output "ID: 1 - Remove user profile. Successful"
Actual Results
Console: No output
It sent a message saying "You don't have permissions to use this command."
Intents
all
System Information
Checklist
Additional Context
No response
The text was updated successfully, but these errors were encountered: