Reputation: 17
I am trying to use this in my code:
if ctx.user.server_permissions.administator:
However, I am being presented with the error:
'Message' object has no attribute 'user'
I have also tried ctx.author.server_permissions.administrator
but neither seems to work.
Upvotes: 0
Views: 188
Reputation: 1782
You can use this:
ctx.author.guild_permissions.administrator
So,
if ctx.author.guild_permissions.administrator:
await ctx.send('You are an administrator!')
else:
await ctx.send('Sorry, you are not an administrator.')
You can also use this:
ctx.message.author.guild_permissions.administrator
So,
if ctx.message.author.guild_permissions.administrator:
await ctx.send('You are an administrator!')
else:
await ctx.send('Sorry, you are not an administrator.')
Upvotes: 2