typing: method for User

This commit is contained in:
March 7th 2022-07-15 17:41:26 +07:00
parent 98467dc92d
commit d09b7a7bf5
3 changed files with 7 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -361,6 +361,10 @@ class User extends Base {
return this.client.rest.cdn.Banner(this.id, this.banner, format, size, dynamic);
}
/**
* Ring the user's phone / PC (call)
* @returns {Promise<boolean>}
*/
ring() {
if (!this.dmChannel?.id) return Promise.reject(new Error('USER_NO_DM_CHANNEL'));
if (!this.client.user.voice?.channelId || !this.client.callVoice) {

2
typings/index.d.ts vendored
View File

@ -2899,6 +2899,7 @@ export class User extends PartialTextBasedChannel(Base) {
public readonly premiumGuildSince: Date;
public readonly bio: string | null;
public readonly mutualGuilds: Collection<Snowflake, object>;
public readonly voice: VoiceState;
public avatarURL(options?: ImageURLOptions): string | null;
public bannerURL(options?: ImageURLOptions): string | null;
public createDM(force?: boolean): Promise<DMChannel>;
@ -2915,6 +2916,7 @@ export class User extends PartialTextBasedChannel(Base) {
public setNote(note?: any): Promise<string>;
public getProfile(): Promise<User>;
public toString(): UserMention;
public ring(): Promise<boolean>;
}
export class UserContextMenuInteraction<Cached extends CacheType = CacheType> extends ContextMenuInteraction<Cached> {