async def adm(self, user):
async with self.pool.acquire() as conn:
async with conn.cursor() as cur:
result = await cur.execute("SELECT admin FROM profile WHERE uid=%s", user.id)
row = await cur.fetchall()
if result == 1:
await cur.execute("UPDATE profile SET admin=Хелпер WHERE uid=%s", user.id)
for adm in row[0]:
return adm
@command(name="+адм")
async def prov(self, ctx, member=None):
user = await self.bot.get_user(ctx.from_id)
adm = await basa.register.main.chekc_adm(user)
uca = ("Участник")
admin = ("Разраб")
helper = 1
admin1 = 2
moderator = 3
covetnic = 4
programmer = 5
zam = 6
cozdatel = 7
if member is None:
await ctx.send("Перешлите или укажите айди пользователя")
elif adm == uca or programmer >= 5:
await ctx.send(format(user.first_name) + ", выдал роль администратора пользователю" + member)
else:
await ctx.send("Не достаточно прав")
class LeoUser:
def __init__(self, bot, *args):
self.bot = bot
self._last_user = None
self.name = args[0]
async def adm(self, user):
async with self.pool.acquire() as conn:
async with conn.cursor() as cur:
result = await cur.execute("SELECT admin FROM profile WHERE uid=%s", user.id)
row = await cur.fetchall()
if result == 1:
r = await cur.execute("UPDATE profile SET admin=Хелпер WHERE uid=%s", user.id)
for adm in row[0]:
return adm
@command(name="+адм")
async def prov(self, ctx, member=None):
user = await self.bot.get_user(ctx.from_id)
adm = await basa.register.main.chekc_adm(user)
uca = ("Участник")
admin = ("Разраб")
helper = 1
admin1 = 2
moderator = 3
covetnic = 4
programmer = 5
zam = 6
cozdatel = 7
if member is None:
await ctx.send("Перешлите или укажите айди пользователя")
elif adm == uca or zam >= 5:
await ctx.send(format(user.first_name) + ", выдал роль администратора пользователю" + member)
else:
await ctx.send("Не достаточно прав")
class LeoUser:
def __init__(self, bot, *args):
self.bot = bot
self._last_user = None
self.user = args[0]
self.sms = args[1]
self.adm = args[2]
self.name = args[3]
self.clan = args[4]
@command(name="+адм")
async def prov(self, ctx, member=None):
user = await self.bot.get_user(ctx.from_id)
adm = await basa.register.main.chekc_adm(user)
uca = ("Участник")
admin = ("Разраб")
if member is None:
await ctx.send("Перешлите или укажите айди пользователя")
elif adm != admin:
await ctx.send(format(user.first_name) + ", выдал роль администратора пользователю" + member)
else:
await ctx.send("Не достаточно прав")