Python Discord Bot - Permissions & Checks

Python Discord Bot - Permissions & Checks

Anson the Developer

4 года назад

27,361 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@sharkkk2314
@sharkkk2314 - 26.04.2023 19:04

for some reason it doesnt work for me, i checked a ton of times, i checked for prems everything it just doesnt work, i tried other ways too

Ответить
@juegosretro1042
@juegosretro1042 - 14.10.2021 18:33

how can I give permissions in on_message? a certain role?

Ответить
@CyberCoding
@CyberCoding - 12.08.2021 04:48

@command.has_permissions(administrator=True)
NameError: name 'command' is not defined
please help with the error

Ответить
@ML-qt5ib
@ML-qt5ib - 10.08.2021 21:06

is there also a possibility that I only get the test from the bot or admin instead of everyone? Or do you happen to know the code for it?

Ответить
@anonymous-be6tw
@anonymous-be6tw - 31.05.2021 18:47

is a way to await that error when a user is missing a permission?

Ответить
@forsaken_by_god
@forsaken_by_god - 22.04.2021 20:40

@Anson the Developer pin please
If you want the bot to tell the user that they need a specific role and not just mention it as an error in the console, just copy paste this

@ban.error
async def ban_error(ctx, error):
if insistance(error, commands.MissingAnyRole):
await ctx.send("You are missing the roles required to execute this command")

Just replace every 'ban' you see with your own command name
Edit the message in the last line

Ответить
@felixjager9094
@felixjager9094 - 17.04.2021 19:11

Hey, how can I make it, that my bot only anwser to one command, if this is in a specific channel?

Ответить
@marcelrieger5182
@marcelrieger5182 - 22.01.2021 17:44

Thx, i searched this option so long xD

Ответить
@lalakbalazs2260
@lalakbalazs2260 - 26.12.2020 14:15

And how do you make it check for an ID?

Ответить
@alexw3003
@alexw3003 - 05.12.2020 06:49

is there a way I can make it so only one user can use it instead of one role(ex. if I wanted to make a role for a friend and he doesn't want anyone else to use it) is it possibly to limit the role perms so he is the only person that can use it.

Ответить
@mememan6198
@mememan6198 - 23.11.2020 19:07

you sound like Karl from Mr beast

Ответить
@codybarber1952
@codybarber1952 - 30.10.2020 17:28

Hi,
I want to do this in a cog. but i get an error. any ideas on how to fix this,
Thanks

Ответить
@golu8045
@golu8045 - 22.10.2020 17:15

Hey bro when I add an event part in my code then everything works properly except which event I made.

Ответить
@electricz3045
@electricz3045 - 27.09.2020 12:00

How can i make that only a single user with users or username have perms to a command?

Ответить
@trende2001
@trende2001 - 20.09.2020 13:17

for some reason my py file keeps crashing because im putting @command.has_permissions at the right spot, is it because atom is crap or something?

Ответить
@tokachai9974
@tokachai9974 - 10.07.2020 19:43

i searched this video for a hours, u are my god

Ответить
@coler7975
@coler7975 - 07.07.2020 03:46

YAY thanks! U got a like.

Ответить
@RodrigoSousa-zi3im
@RodrigoSousa-zi3im - 31.05.2020 23:38

I got a question. I got it to work but I wanted to add a message if the person using the command hadn't the permissions like

"You don't have the permissions to use this command"

I tried else statement but didn't work.

Edit:
I got it to work with the error command

Ответить
@fr_ite4679
@fr_ite4679 - 03.04.2020 08:55

I did it, but nothing displayed in either the channel or editor software. I use PyCharm. Anyone know how to fix this?

Ответить
@JN-lh6qq
@JN-lh6qq - 29.03.2020 13:22

It worked for me. Thanks :p

Ответить