New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with commands.is_owner() #5741
Comments
add owner_id bot = commands.Bot(command_prefix='>', owner_id = 177494227918389249) |
You don't have to set the owner_id, it gets fetched automatically on first use. I definitely cannot repro this nor I imagine this is an issue with the library since it would be a huge security risk that would affect thousands of users. I suspect there's something going on in your configuration so this will need more information. |
could it be the bot is owned by a team instead of an individual user? |
@AEnterprise In recent discord.py versions, teams are included in the is_owner() decorator |
Pretty sure his point is that he is setting discord.py/discord/ext/commands/bot.py Lines 317 to 328 in 1c3b0c0
|
@Phxntxm Ah, I forgot about that |
I did directly set the owner_id, and I am sure the ID is valid. As Helish88 told me to do so, my client object already looks like that. Even if I am explicitly setting the owner_id it should work. What more information can I provide? |
Currently this issue is mainly saying that sometimes an exception happens and sometimes it doesn't. It's unclear what this really means. For all we know the 3 attempts that failed could have been your server members trying to run it. |
client = commands.Bot(command_prefix="$", help_command=None, owner_id=335469153869889547) Above is my client object. @commands.command()
@commands.is_owner()
async def test(self, ctx):
await ctx.send(“Do something”) Above is my command. Originally I was doing it with an eval command and then I changed over to test to see if it was something with the command it self.
I’ve tested it several times, it works for the first 1-2 tries and then throws the you do not own this bot error. |
And yes I have tried removing the owner_id field, that’s how it initially started. But then I thought you have to explicitly state the owner_id which I did. |
Ok so it works now. And I’m an idiot. |
Summary
@commands.is_owner() behaving incorrectly.
Reproduction Steps
Expected Results
It should work by only allowing the owner to run it.
Actual Results
It works, but it fails on some of the attempts. I made an eval command and I put the decorator onto it (in a cog yes), the command worked 2/5 times and the other 3 attempts in the console I got an error stating that you are not the owner of the bot.
Traceback-
x3
Checklist
System Information
The text was updated successfully, but these errors were encountered: