@Cog.listener()
async def on_message_new(self, message):
user = await self.bot.get_user(message.from_id)
reg = await basa.register.main.register()
if reg is None:
print(user.id)
reg = await basa.register.main.register(user)
await message.send(format(user.first_name) + ", добро пожаловать")
return await reg
class dbsql():
pool: Pool = db_pool
async def register(self):
async with self.pool.acquire() as conn:
async with conn.cursor() as cur:
result = await cur.execute("SELECT * FROM profile WHERE uid")
row = await cur.fetchall()
if result == 0:
await cur.execute('INSERT INTO profile(uid) VALUES (uid)')
else:
return await row
reg = await basa.register.main.register(user)
TypeError: register() takes 1 positional argument but 2 were given
async def register(self):
reg = await basa.register.main.register(user)
TypeError: register() принимает 1 позиционный аргумент, но было задано 2