#Timeout Command

1 messages · Page 1 of 1 (latest)

amber mason
#

I cannot create a timeout command

inland templeBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

rapid helm
#

How so? what part are you stuck on?

amber mason
amber mason
violet compass
#

Does the bot have the needed perms to timeout that user?

wispy root
#

oh dear

#

you made the mistake of using datetime.now()

#

most likely whats happening is that your computers timezone is 4+ hours behind utc

#

discord uses utc extensively, but now() uses your timezone's time

#

so if your current time is 4 hours behind, adding three hours means the timeout end time is still much before the current time in utc

#

anyways your solution is using interactions.Timestamp.utcnow() or:

from datetime import datetime, timezone
datetime.now(timezone.utc)
#

datetime.utcnow() is likely to screw you over for many reasons (mostly that it doesnt set the actual timezone of the datetime as utc for some reason), try not to use it 😅

wispy root
#

sus /j

#

okay let me take a look at the code rq

#

ah

#

...um, timeouts parameters dont include end

#

im not sure how this isnt erroring out horribly

#

because it should

amber mason
#

lol

#

pretty sure i got an error saying end didnt exist or smth so changed it to be this instead

wispy root
#

communication_disabled_until

#

thats what it is lol

#

or you could have just passed it in with no kwargs

amber mason
#

hold up, this command was one of the first ones i added and ive been using coc.py the past couple hours

wispy root
#

i have my suspicions that you did a basic port from some other library that used end

amber mason
#

Hmm idk I’ll see