#communicationDisabledUntil issue

1 messages · Page 1 of 1 (latest)

full geyser
#

@dusk gull

cobalt minnow
#

Heyy I want help with that sunglas

light surge
#

uhh

dusk gull
full geyser
dusk gull
#

U got da code, U seen I logged the correct thing and it did log the date

cobalt minnow
#

I meant I just want to see lol

cobalt minnow
dusk gull
#

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

cobalt minnow
#

if(pers.communicationDisabledUntil) I don't think that checks if the user is timedout

dusk gull
#

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

cobalt minnow
#

But you aren't checking if it's null or not

dusk gull
#

Javascript does tht for u, null or undefined are falsey values iirc

cobalt minnow
#

Isn't that just if (user is muted until time)

dusk gull
#

If they timed out, itll show a date for when the timeout is ending

cobalt minnow
#

Yes, but you have to make sure they are timedout

dusk gull
#

else itll show null, in my case I get undefined when I eval and check if they timed out'

dusk gull
cobalt minnow
#

One sec let me check communicationDisabledUntil on djs

dusk gull
#

alr

cobalt minnow
#

It just returns a date though

dusk gull
#

Ye, The date the timeout is ending if there is no timeout, its supposed to return null

cobalt minnow
#

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

dusk gull
#

No, its nullable. It returns null if there is no date for the timeout ending aka no timeout

cobalt minnow
#

if (date != null) ?

#

Or javascript does that?

dusk gull
dusk gull
#

Im supposed to recieve null

cobalt minnow
#

Wait wait

#

On the video

#

The user is not timedout

#

It says the user is timedout

dusk gull
#

Exactly

cobalt minnow
#

Meaning your if statement

dusk gull
#

Is false

#

exactly

cobalt minnow
#

Returned true

dusk gull
#

yes

#

when its supposed to be false

#

Thats why im here

cobalt minnow
#

Did you try that != null?

dusk gull
#

Ill try it jus to confirm to u

cobalt minnow
#

👍

dusk gull
#

New code

#

Same result

cobalt minnow
#

D:

#

await message.guild.members.fetch(args[0] ?? '266241948824764416').catch(() => {});

dusk gull
cobalt minnow
#

What's this part for pers?

dusk gull
#

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

cobalt minnow
#

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

dusk gull
#

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

cobalt minnow
#

In the video

dusk gull
#

If tht makes sense

#

Ill try tho

cobalt minnow
#

There is something in the console log right?

cobalt minnow
#

Because you debuged it

#

console.log(pers.communicationDisabledUntil)

dusk gull
#

Ye

#

There is something in console

#

the date

cobalt minnow
#

That didn't return null

dusk gull
#

Nope

cobalt minnow
#

That means it isn't null

dusk gull
#

Exactly

#

But, look at this

cobalt minnow
#

The if statement works correct

#

Isn't that just an api issue?

dusk gull
#

Shockwave isnt timed out, and look at what I did for the eval command

cobalt minnow
#

Can you make me aware of something

#

What is this new error (reading "")

dusk gull
#

Wassup

junior pagoda
#

but what method to timeout a member? any guide?

cobalt minnow
cobalt minnow
junior pagoda
junior pagoda
#

👍

dusk gull
cobalt minnow
#

❀

dusk gull
#

My errors dont throw like tht tho

cobalt minnow
dusk gull
#

Ye, if member is declared. If member isnt declared, itll throw a reference error, member is not defined

cobalt minnow
#

13.4 feature?

dusk gull
#

Nah thats js

cobalt minnow
#

Since when

dusk gull
#

I believe forever, as I said my errors dont throw like tht I jus learnt it off context clues

junior pagoda
#

@cobalt minnow and do you know the time limit?

light surge
#

command work but after that this error

cobalt minnow
dusk gull
#

@full geyser U got any idea or like

#

is this API thing.... yk

light surge
#

oh what

#

sorry

cobalt minnow
#

Also my eval commands never returned reading

light surge
#

i was confused why is he saying go away 😂

dusk gull
#

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

cobalt minnow
#

Because this thread is not for you D:

light surge
dusk gull
#

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

full geyser
#

You also have to check if the timeout is actually in the future too

dusk gull
#

Hollon

#

December 26th 2021, 1:37:50 am

full geyser
#

Or no, that’s in the future?

dusk gull
#

Thats da future

full geyser
#

Oh, you never fixed the moment issue

dusk gull
#

Thats weird tho, could it have been a discord error and not api?

dusk gull
full geyser
#

Since ur hosting, it’s prob using the local time of the machine

cobalt minnow
dusk gull
#

Not only tht, I missed spelt it in the message, maybe moment has a default. I do have the raw date tho

full geyser
#

Moment defaults to the current time

#

But it’s using the machine's local time zone

dusk gull
#

Yeah, lemme get the raw date

cobalt minnow
#

so communicationDisabledUntil will never return null

dusk gull
#

2021-12-26T00:10:41.409Z

full geyser
#

If someone removes the timeout

dusk gull
full geyser
#

Or the person was never timed out

cobalt minnow
#

So if a member is not timed out it returns null

dusk gull
#

December 26th 2021, 1:10:41 am

#

Thts the tru date

full geyser
#

What’s the tz?

dusk gull
#

The absolute correct date

dusk gull
#

Thats what I got from logging pers.communicationDisabledUntil thing

#

Wait no I got 9Z

full geyser
#

Nothing after the Z?

dusk gull
#

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

dusk gull
#

2021-12-26T00:10:41.409Z

full geyser
#

It’s 12/26/21 1am UTC

dusk gull
#

Ye

full geyser
#

11:00, so that means the date is in the past

#

Or no, 12 + 1 = 13

dusk gull
#

So, the API didn't change anything?

full geyser
#

Still in the past

#

No

#

It doesn’t rly need to

dusk gull
#

Thats weird

full geyser
#

It’s easier if it doesn’t bc it doesn’t have to keep a timer and emit events

dusk gull
#

Tru tru, why not make it a function tho? That makes the chances of gettin this smaller

full geyser
#

Wdym make it a function?

#

It’s a property

dusk gull
#

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

full geyser
#

You can implement that yourself?

dusk gull
#

ye Ik, but like yk

#

this error

#

I believe that caused the error, cuz as u said its in da past

full geyser
#

Like I said, add a check to make sure the timeout is in the future

dusk gull
#

I did timeout shockwave in the past

dusk gull
full geyser
#

Well, you can still edit the timeout

dusk gull
#

Gotchu

#

Thnx

full geyser
#

It’s not like kick or ban where it’s a one-time thing

light surge
#

in the way of timeout

dusk gull
#

Tru tru, Imma try tht

light surge
#

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

full geyser
#

Max is 28 days

light surge
#

yep

full geyser
#

Trim the message to fit into 2000 characters

light surge
#

.........

#

ill sleep bye