G
G
Gumballson2020-11-29 15:38:07
Python
Gumballson, 2020-11-29 15:38:07

How to say that if a member has a role, then do not give out this role?

@client.command(aliases=['case','кейс'])
async def open_case(ctx):
  if cursor.execute("SELECT gems from users where id = {}".format(ctx.author.id)).fetchone()[0] < 120:
    await ctx.send(f"**{ctx.author}**, у вас недостаточно {gem} для покупки кейса")
  else:
    cursor.execute("UPDATE users set gems = gems - 120")
    randomik = (random.randint(1,9961))
    priv = discord.utils.get(ctx.author.guild.roles, id = 782197209331793951 )
    vip = discord.utils.get(ctx.author.guild.roles, id = 782325000652193822 )
    vipp = discord.utils.get(ctx.author.guild.roles, id = 782325003357650974 ) #если есть эта роль не выдавать
    premium = discord.utils.get(ctx.author.guild.roles, id = 782325012648296499 )
    premiump = discord.utils.get(ctx.author.guild.roles, id = 782325022378950656 )
    mafia = discord.utils.get(ctx.author.guild.roles, id = 782325016066523136 )
    god = discord.utils.get(ctx.author.guild.roles, id = 782325010681298994 )
    falen_angel = discord.utils.get(ctx.author.guild.roles, id = 782325023041519627 )
    if randomik < 7000:
      await ctx.author.add_roles(vip,priv) #вот эти роли
      await ctx.send(f'Поздравляю, **{ctx.author}**, ты выбил привелегию **Vip 70%**')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Chaka YS, 2020-11-29
@Gumballson

@client.commands(aliases = ['mine','шахта'])
# =============================================================================================
@commands.has_any_role("Шахтёр", 'Человек') # Здесь названия ролей, которые могут пользоваться данной командой.(Через запятую и в ковычках)
# =============================================================================================
@cooldown(1,3600,BucketType.user)
async def __mine(ctx):
  и тут твой код..........

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question