L
L
lr_udbe_9992021-12-06 18:35:02
Python
lr_udbe_999, 2021-12-06 18:35:02

How to make the bot count how many hours he is online?

Discord.py library.

I have a command which, in fact, when you enter it, should show how many hours he is online. Here is the command code:

if message.content == '!инфо-бот':
            await message.channel.send('Информация о боте: \n 1. Бот онлайн - ')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
paran0id, 2021-12-06
@paran0id

You save the timestamp to a variable after launch, then at the time of the request for information you subtract it from the current one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question