#communicationDisabledUntil issue
1 messages · Page 1 of 1 (latest)
Heyy I want help with that 
uhh
Make ur own thread and/or ask in support channel
U got da code, U seen I logged the correct thing and it did log the date
I meant I just want to see lol
Could you provide the code, maybe I can help
Says the person is timed out when they are not, only happens to shockwave but Im gettin help on it incase it happens to other members using my bot
if(pers.communicationDisabledUntil) I don't think that checks if the user is timedout
That checks if they have a date till the timeout ends, its nullable, for some reason, it logs the date tho and as u seen, shockwave is not timed out
But you aren't checking if it's null or not
Javascript does tht for u, null or undefined are falsey values iirc
Isn't that just if (user is muted until time)
If they timed out, itll show a date for when the timeout is ending
Yes, but you have to make sure they are timedout
else itll show null, in my case I get undefined when I eval and check if they timed out'
Ye the if statement does tht
One sec let me check communicationDisabledUntil on djs
alr
It just returns a date though
Ye, The date the timeout is ending if there is no timeout, its supposed to return null
if (date)
I know what date it is, I'm just saying
if (date) is not checking anything
I haven't done js in a while, but I'm pretty sure you need to check if its null or not
No, its nullable. It returns null if there is no date for the timeout ending aka no timeout
Even if I check if its null or not, above that I logged the same thing and got the value
Exactly
Meaning your if statement
Returned true
Did you try that != null?
Ill try it jus to confirm to u
đ
D:
await message.guild.members.fetch(args[0] ?? '266241948824764416').catch(() => {});
Yeah so thts why I was in #archive-library-discussion but yk
What's this part for pers?
That's to fetch if there's no mention but provided argument is an ID, The 2666 whatever is a dummy snowflake, since if u provide undefined, null or no value to fetch's params, itll jus fetch every member instead of rejecting the promise
Idk mane Ill jus have to Alert all the users using my bot the timeout command can bug lol
Try without the dummy part
I don't see the need for it
The rest of the code looks fine
Another unrelated thing is you don't need to check if message.guild.ownerId because the owner would be higher than them I'm pretty sure
WAIT WAIT WAIT
If there is no mention, but there is an ID for args[0], itll fetch that ID and return the guildmember. If there is no mention/no argument, args[0] will be undefined. If the passed param for .fetch() is undefined, null or nothing at all, itll fetch every member, so I added a dummy snowflake so itll throw an unknown user error that I can catch n make pers' value undefined
In the video
There is something in the console log right?
Wait no, I remember testin tht
That didn't return null
Nope
That means it isn't null
Shockwave isnt timed out, and look at what I did for the eval command
Wassup
but what method to timeout a member? any guide?
.timeout
inside? miliseconds?
ahhh ok, thanks
đ
Thats telling u which property is undefined iirc, example: message.member.username Cannot read property 'username' of undefined ( reading "member") Or something like tht
â€ïž
My errors dont throw like tht tho
For example for member.username that would say reading member?
Ye, if member is declared. If member isnt declared, itll throw a reference error, member is not defined
13.4 feature?
Nah thats js
Since when
I believe forever, as I said my errors dont throw like tht I jus learnt it off context clues
@cobalt minnow and do you know the time limit?
command work but after that this error
Go away
The content u provided is an empty string, back to the channel lol this is for my error
@full geyser U got any idea or like
is this API thing.... yk
Probably
Also my eval commands never returned reading
i was confused why is he saying go away đ
I jus wanted to report this error so other people usin my bot wont have this issue, Imma timeout shockwave n untimeout manually n see if it returns the date still
Because this thread is not for you D:
ik that now ;-;
alr
Timing him out and removing it manually fixed the error, but the error is still unknown and has an unknown fix so idk what we gonna do abt tht
Beside tht tho thnx yall
The timeout looks like itâs old
You also have to check if the timeout is actually in the future too
Yh thts wut I seen, but could tht have been a random date?
Hollon
December 26th 2021, 1:37:50 am
Or no, thatâs in the future?
Thats da future
Oh, you never fixed the moment issue
Thats weird tho, could it have been a discord error and not api?
Right right
Since ur hosting, itâs prob using the local time of the machine
But shouldn't user.communicationDisabledUntil return null if user is not timedout
Not only tht, I missed spelt it in the message, maybe moment has a default. I do have the raw date tho
Yeah, lemme get the raw date
so communicationDisabledUntil will never return null
2021-12-26T00:10:41.409Z
It can
If someone removes the timeout
Nah it would, jus the message I sent I misspelled it
Or the person was never timed out
It doesnât rly need to
So if a member is not timed out it returns null
Whatâs the tz?
The absolute correct date
I do not know
Thats what I got from logging pers.communicationDisabledUntil thing
Wait no I got 9Z
Nothing after the Z?
Mane this whole things confusing, this error is unknown. I managed to fix it by timing out and untiming out manually but like yk this can still happen again
Itâs 12/26/21 1am UTC
Ye
So, the API didn't change anything?
Thats weird
Itâs easier if it doesnât bc it doesnât have to keep a timer and emit events
Tru tru, why not make it a function tho? That makes the chances of gettin this smaller
Exactly, run the function everytime u wanna get the communication DisabledUntil
So it wouldn't have like a fixed value if u know wut I mean
You can implement that yourself?
ye Ik, but like yk
this error
I believe that caused the error, cuz as u said its in da past
Like I said, add a check to make sure the timeout is in the future
I did timeout shockwave in the past
And if it is, I gotta tell the member to timeout the person manually?
Well, you can still edit the timeout
Itâs not like kick or ban where itâs a one-time thing
in the way of timeout
Tru tru, Imma try tht
i have code but if i choosed time longer than 3 weeks bot crashed
how can i make it send message if its over that
Max is 28 days
yep
Trim the message to fit into 2000 characters