Answer the question
In order to leave comments, you need to log in
How to make a command that will show all the hours and minutes for being in the voice on the server?
How to make a command that could show all the hours and minutes of being on the server in voice channels when it is entered? The command itself is already there and @bot.event:
@bot.event
async def on_voice_state_update(member, before, after):
with open('c:/Python/TOXBOT/database.json', 'r', encoding = "utf-8") as file:
data = json.load(file)
author = member.id
if before.channel is None and after.channel is not None:
t1 = time.time()
data[str(author)]['Онлайн'] = t1
elif before.channel is not None and after.channel is None and author in tdict:
t2 = time.time()
print(t2-tdict[author])
data[str(author)]['Онлайн'] + data[str(author)]
with open('c:/Python/TOXBOT/database.json', 'w', encoding = "utf-8") as file:
json.dump(data, file)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question