#Counting time in a voice.
1 messages · Page 1 of 1 (latest)
user joins voice, mark a timestamp. They leave, mark another timestamp. Calculate the diferences
Good idea, I thought so before, but I want to make it more delusional)
@tasks.loop(minutes=1)
async def voice_check():
for channel in bot.guilds[0].voice_channels:
for member in channel.members:
I already wrote about my mistake in the first cycle, even after reading the documentation that you sent me, I can’t finish it.
show all code from ur task
@tasks.loop(minutes=1)
async def voice_check():
for channel in bot.guilds[0].voice_channels:
for member in channel.members:
cursor.execute("UPDATE users SET timeInVoice = timeInVoice + 1 WHERE id = {}".format(member.id))
connection.commit()
voice_check.start()
you need before task
ur task start when ur bot is not ready
and I think bcz that bot.guilds is a empty list
I sent a cooking cutout with the code, bot. Everything seems to be working. I just need to know how to make a loop for all guild voice meetings that have my bot.
Even if I try "for channel in bot.guilds.voice_channels:", I get an error: 'list' object has no attribute 'voice_channels'. Help me, please.
read ur error
How to make a loop in this case?
I already tried to make it so that the cycle was for one server. Help, please, I can not figure out how to solve the problem at all.
for channel in bot.guilds(bot.get_guild(id)).voice_channels:
That's wrong
Yes, I already know that is not true. How to make a cycle?