K
K
kiber_byblik_natasha2020-09-12 01:07:31
Bots
kiber_byblik_natasha, 2020-09-12 01:07:31

User access to Discord.py?

How to give the user access to the command?
So that both I and that person can use it._ .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2020-09-12
@Alexandre888

compare the id of the user who entered the command with the id of the user who has access.

M
Maxim Nevzorov, 2020-09-12
@fixator10

More specific solution, use "checks" (check): https://discordpy.readthedocs.io/en/stable/ext/com...

async def special_command_check(ctx):
    return ctx.author.id in [204191975222080878, 544689912660601908]

@commands.check(special_command_check)
@bot.command()
async def scmd(ctx):
    await ctx.send("You can run this command!")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question