@client.command(aliases = ['fbuy', 'fbuyrole'])
async def __funbuy(ctx, rol: discord.Role = None):
if rol is None:
await ctx.send(embed = discord.Embed(description = "Вы не указали роль, которую желаете приобрести", color = 0xB4FF1F))
else:
if rol in ctx.author.roles:
await ctx.send(embed = discord.Embed(description = "У Вас уже имеется данная роль", color = 0xB4FF1F))
elif cursor.execute("SELECT costing FROM funshop WHERE fun_id_role = {}".format(rol.id)).fetchone()[0] > cursor.execute("SELECT cash FROM users WHERE id = {}".format(ctx.author.id)).fetchone()[0]:
await ctx.send(embed = discord.Embed(description = "У Вас недостаточно средств на балансе", color = 0xB4FF1F))
else:
await ctx.author.add_roles(rol)
cursor.execute("UPDATE users SET cash = cash - {} WHERE id = {}".format(cursor.execute("SELECT costing FROM funshop WHERE fun_id_role = {}".format(rol.id)).fetchone()[0], ctx.author.id))
await ctx.message.add_reaction("✅")