Skip to content

Commit

Permalink
yeah
Browse files Browse the repository at this point in the history
  • Loading branch information
cop-discord committed May 21, 2024
2 parents 1b1afd8 + 3fc9b1a commit 5cd5946
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
18 changes: 6 additions & 12 deletions discord/ext/commands/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,13 +893,10 @@ async def _fill(self, ctx: Context[BotT]):
for check in checks:
if " has_permissions" in str(check):
ctx.permissions.value = 0

if asyncio.iscoroutinefunction(check): invoke = await check(ctx)
else: invoke = check(ctx)
try:
if asyncio.iscoroutinefunction(check):
invoke = await check(ctx)
else:
invoke = check(ctx)
command.perms = list(invoke.cr_frame.f_locals['perms'].keys())
command.perms = list(check(ctx).cr_frame.f_locals['perms'].keys())

except errors.MissingPermissions as err:
command.perms = err.missing_permissions
Expand All @@ -912,13 +909,10 @@ async def _fill(self, ctx: Context[BotT]):

elif " bot_has_permissions" in str(check):
ctx.bot_permissions.value = 0

if asyncio.iscoroutinefunction(check): invoke = await check(ctx)
else: invoke = check(ctx)
try:
if asyncio.iscoroutinefunction(check):
invoke = await check(ctx)
else:
invoke = check(ctx)
command.bot_perms = list(invoke.cr_frame.f_locals['perms'].keys())
command.bot_perms = list(check(ctx).cr_frame.f_locals['perms'].keys())

except errors.BotMissingPermissions as err:
command.bot_perms = err.missing_permissions
Expand Down
2 changes: 1 addition & 1 deletion discord/ext/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def is_running(self) -> bool:

async def _error(self, *args: Any) -> None:
exception: Exception = args[-1]
_log.error('Unhandled exception in internal background task %r.', self.coro.__name__, exc_info=exception)
_log.error(f'Unhandled exception in internal background task {self.coro.__name__}.', exc_info=exception)

def before_loop(self, coro: FT) -> FT:
"""A decorator that registers a coroutine to be called before the loop starts running.
Expand Down

0 comments on commit 5cd5946

Please sign in to comment.