D
D
dariarows2020-08-19 11:48:56
Python
dariarows, 2020-08-19 11:48:56

How to make a discord bot send messages at a specific time?

It is necessary that the bot send a message at a given time without a command. Submit code sample or article if possible.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
a, 2020-08-19
@MZOK

import time

while True:
    time.sleep(60) #Время в секундах 
    send()

I
InDust, 2020-08-19
@InDust

You create a variable with time, using the time module.
Then, using the if statement, you check whether the variable is equal to time, with the time you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question