Answer the question
In order to leave comments, you need to log in
Error AttributeError: 'int' object has no attribute 'id' how to fix?
Hello, the error occurs AttributeError: 'int' object has no attribute 'id'
Here is the code:
@tasks.loop(seconds=2.0)
async def ban_loop():
getdatanow = datetime.now().date()
for ban in sql.execute(F"SELECT days FROM bans"):
ban1 = datetime.strptime(ban[0], "%Y-%m-%d").date()
if getdatanow >= ban1:
sql.execute(f"UPDATE bans SET ex = 1")
db.commit()
print(getdatanow >= ban1)
for bans in sql.execute(f"SELECT banned FROM bans WHERE ex = 1"):
guild = client.get_guild(806633419865718784)
await guild.unban(bans[0])
print('Пользователь разбанен по истечению длительности наказания')
Answer the question
In order to leave comments, you need to log in
guild.unban() expects an object of the User class as an argument, not a number.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question