Ask coding questions

← Back to all posts
How to make a "Countdown" Command on a Discord bot?
ntomoon (0)

How do you make a countdown then a bot mentioning a role after the countdown ends? I'm using Python. (I NEED A PROPER ANSWER THIS TIME!!)

Comments
hotnewtop
ch1ck3n (2088)

im not sure but this might work

import time


@bot.command()
async def countdown(ctx, arg):
    t = arg
    while t:
        mins, secs = divmod(t, 60)
        timer = '{:02d}:{:02d}'.format(mins, secs)
        ctx.send(timer)
        time.sleep(1)
        t -= 1

$countdown 5

ch1ck3n (2088)

wdym proper answer

lmao disappointed you