Answer the question
In order to leave comments, you need to log in
How to make the bot write messages and then delete them?
@bot.message_handler(commands=['go'])
def mess (message):
time.sleep(1)
bot.send_message (message.chat.id, "Привет")
bot.register_next_step_handler (message, deleted)
def deleted (message):
for far in range ((message.message_id-1), message.message_id):
bot.delete_message(message.chat.id, far)
mess(message)
Answer the question
In order to leave comments, you need to log in
await ctx.channel.purge(limit = 1) #Command to delete the last message
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question