-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Member): set and reset guild timeouts #302
Conversation
Since Member entity already is a part of Guild, I think just |
oh ok, wanted to avoid confusion with timeouts as in network reqs |
src/structures/member.ts
Outdated
* Resets Timeout for the Member | ||
*/ | ||
async resetTimeout(reason?: string): Promise<Member> { | ||
return await this.setTimeout(undefined, reason) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use null
to remove timeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MemberData.communicationDisabledUntil is Date | undefined, it's not nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, then it must be implemented wrong
from this it is nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, that's pretty strange, does it function right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, even the official discord client uses null
to remove timeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i mean does harmony's impl work, since its wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, probably not because undefined
means that we don't want to change the value, not removing it
but again it's just MemberData
type that is wrong, so changing the type or do will work@ts-ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, we forgot to add | null
to MemberData
's communication_disabled_until
. Can you do that, and change this to null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
About
Adds setGuildTimeout and resetGuildTimeout functions to easily modify guild timeouts for a Member.
Previously, you could only do this by using Member.edit
Status