ctx.author.guild_permissions.administrator being false or ctx.author.guild_permissions being missing.
Actual Results
An error, traceback:
Ignoring exception in command test_command:
Traceback (most recent call last):
File "C:\Users\Jérémie\Documents\GitHub\pycord\discord\commands\core.py", line 138, in wrapped
ret = await coro(arg)
^^^^^^^^^^^^^^^
File "C:\Users\Jérémie\Documents\GitHub\pycord\discord\commands\core.py", line 1904, in _invoke
await self.callback(ctx, target)
File "C:\Users\Jérémie\Documents\GitHub\pycord\thing.py", line 27, in test_command
await ctx.respond(f"{ctx.author.guild_permissions.administrator}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jérémie\Documents\GitHub\pycord\discord\member.py", line 706, in guild_permissions
base.value |= r.permissions.value
^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'permissions'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Jérémie\Documents\GitHub\pycord\discord\bot.py", line 1149, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\Jérémie\Documents\GitHub\pycord\discord\commands\core.py", line 435, in invoke
await injected(ctx)
File "C:\Users\Jérémie\Documents\GitHub\pycord\discord\commands\core.py", line 146, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'permissions'
Intents
n/a
System Information
master
Checklist
[X] I have searched the open issues for duplicates.
[X] I have shown the entire traceback, if possible.
[X] I have removed my token from display, if visible.
Summary
When using a user-installed message command in a guild the bot is not present in, accessing
ctx.author.guild_permissions
raises an errorReproduction Steps
Run the below code, user-install the bot and run the message command on a message in a guild the bot is not present in.
Minimal Reproducible Code
Expected Results
ctx.author.guild_permissions.administrator
being false orctx.author.guild_permissions
being missing.Actual Results
An error, traceback:
Intents
n/a
System Information
master
Checklist
Additional Context
No response