Discord bot check if user is admin

后端 未结 3 1205
滥情空心
滥情空心 2021-01-13 16:28

Hi i\'m new to python coding with discord and I have tried to make a command that tells the user if they are a admin or not but well... its not working in the slightest

3条回答
  •  不知归路
    2021-01-13 16:45

    If message.author.server_permissions.administrator doesn't work.

    Change it to message.author.guild_permissions.administrator

    Or try message.author.top_role.permissions.administrator, this will return you a bool.

    One thing is, normally the server owner sets the administrator to the server top role, so this will work most of the time. But if they don't, the third sol won't work.

提交回复
热议问题