feat: Member.timeout helper alias

This commit is contained in:
Yuzu 2022-08-02 19:48:42 -05:00
parent fecd90a6f4
commit 07e3169aa1
2 changed files with 6 additions and 1 deletions

View File

@ -401,7 +401,7 @@ export interface ModifyGuildMember {
mute?: boolean;
deaf?: boolean;
channelId?: Snowflake;
communicationDisabledUntil?: number;
communicationDisabledUntil?: number | null;
}
/**

View File

@ -141,6 +141,11 @@ export class Member implements Model {
return member;
}
/** calls {@link Member#edit} which calls {@link Guild#editMember} under the hood */
async timeout(time: number | null) {
await this.edit({ communicationDisabledUntil: time });
}
/** adds a role to this member */
async addRole(roleId: Snowflake, reason?: string): Promise<void> {
await Guild.prototype.addRole.call(