bot.owner_ids = [your ids here] # Mine were [876055467678375998, 741904523991449674]
Not setting owner IDs would raise another error, that's
Ignoring exception in command help:
Traceback (most recent call last):
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/help.py", line 835, in command_callback
return await self.send_bot_help(mapping)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/help.py", line 1029, in send_bot_help
filtered = await self.filter_commands(bot.commands, sort=True, key=get_category)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/help.py", line 580, in filter_commands
valid = await predicate(cmd)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/help.py", line 574, in predicate
return await cmd.can_run(self.context)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1124, in can_run
return await discord.utils.async_all(predicate(ctx) for predicate in predicates) # type: ignore
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/utils.py", line 537, in async_all
elem = await elem
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 2103, in predicate
if not await ctx.bot.is_owner(ctx.author):
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 356, in is_owner
raise AttributeError('Owners aren\'t set.')
AttributeError: Owners aren't set.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 996, in invoke
await ctx.command.invoke(ctx)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 894, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 176, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: Owners aren't set.
Anyway, once you set owner_ids, you can run either the help or ping (or the command you created) to reproduce the error.
Ignoring exception in command help:
Traceback (most recent call last):
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/help.py", line 835, in command_callback
return await self.send_bot_help(mapping)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/help.py", line 1029, in send_bot_help
filtered = await self.filter_commands(bot.commands, sort=True, key=get_category)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/help.py", line 580, in filter_commands
valid = await predicate(cmd)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/help.py", line 574, in predicate
return await cmd.can_run(self.context)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1124, in can_run
return await discord.utils.async_all(predicate(ctx) for predicate in predicates) # type: ignore
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/utils.py", line 537, in async_all
elem = await elem
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 2103, in predicate
if not await ctx.bot.is_owner(ctx.author):
TypeError: object bool can't be used in 'await' expression
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 996, in invoke
await ctx.command.invoke(ctx)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 894, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/root/code/Templates/Selfbot/venv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 176, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: object bool can't be used in 'await' expression
Results
The help command, and any commands with is_owner shouldn't error when called, but they do.
System Information
That's broken too, addressed in #240.
Using commit 0f2dda9dd4392039576243a27fc34f7ab9542e2e on branch rebase. Installed using pip install git+https://github.com/dolfies/discord.py-self@rebase.
bot.is_owner is defined on Line 330 of discord.ext.commands/bot.py. This function could be made async to reduce the amount of changes made to the codebase but 😬, I'm going to make a PR that replaces all calls to is_owner that use await.
Summary
If you set owners, and have commands that use the is_owner decorator, an error regarding a non-async function being awaited will be raised.
Reproduction Steps
Create a command that's owner only
For example.
Then set owner IDs -
Not setting owner IDs would raise another error, that's
Anyway, once you set
owner_ids
, you can run either thehelp
orping
(or the command you created) to reproduce the error.Results
The
help
command, and any commands withis_owner
shouldn't error when called, but they do.System Information
That's broken too, addressed in #240.
Using commit 0f2dda9dd4392039576243a27fc34f7ab9542e2e on branch rebase. Installed using
pip install git+https://github.com/dolfies/discord.py-self@rebase
.Issue present on Line 2103 of discord.ext.commands/core.py. Going to use
grep
to view all occurrences ofawait ctx.bot.is_owner
.bot.is_owner
is defined on Line 330 of discord.ext.commands/bot.py. This function could be made async to reduce the amount of changes made to the codebase but 😬, I'm going to make a PR that replaces all calls to is_owner that use await.