mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
feat: VoiceChannel.setVoiceState (#186)
* feat: threads methods * fix: typing * fix: fixes * feat: setVoiceState * fix: return promise
This commit is contained in:
parent
989efb172e
commit
f9cc5da7cc
@ -253,5 +253,8 @@ export interface ChannelRoutes {
|
|||||||
args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIChannelWebhookJSONBody>,
|
args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIChannelWebhookJSONBody>,
|
||||||
): Promise<RESTPostAPIChannelWebhookResult>;
|
): Promise<RESTPostAPIChannelWebhookResult>;
|
||||||
};
|
};
|
||||||
|
'voice-status': {
|
||||||
|
put(args: RestArguments<ProxyRequestMethod.Put, { status: string | null }>): Promise<never>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,10 @@ export class ChannelShorter extends BaseShorter {
|
|||||||
query,
|
query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setVoiceStatus(channelId: string, status: string | null = null) {
|
||||||
|
return this.client.proxy.channels(channelId)['voice-status'].put({ body: { status } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ChannelShorterOptionalParams = Partial<{ guildId: string; reason: string }>;
|
export type ChannelShorterOptionalParams = Partial<{ guildId: string; reason: string }>;
|
||||||
|
@ -352,6 +352,10 @@ export class VoiceChannelMethods extends DiscordBase {
|
|||||||
return this.edit({ video_quality_mode: VideoQualityMode[quality] }, reason);
|
return this.edit({ video_quality_mode: VideoQualityMode[quality] }, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setVoiceState(status: string | null = null) {
|
||||||
|
return this.client.channels.setVoiceStatus(this.id, status);
|
||||||
|
}
|
||||||
|
|
||||||
async states() {
|
async states() {
|
||||||
if (!this.guildId) return [];
|
if (!this.guildId) return [];
|
||||||
const states = await this.cache.voiceStates?.values(this.guildId);
|
const states = await this.cache.voiceStates?.values(this.guildId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user