mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-01 16:40:07 +00:00
feat(ApplicationsAPI): add getActivityInstance method (#11482)
feat(core): add getActivityInstance to ApplicationsAPI Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import type { RequestData, REST } from '@discordjs/rest';
|
||||
import {
|
||||
Routes,
|
||||
type RESTGetAPIApplicationActivityInstanceResult,
|
||||
type RESTGetAPIApplicationEmojiResult,
|
||||
type RESTGetAPIApplicationEmojisResult,
|
||||
type RESTGetCurrentApplicationResult,
|
||||
@@ -136,4 +137,23 @@ export class ApplicationsAPI {
|
||||
) {
|
||||
await this.rest.delete(Routes.applicationEmoji(applicationId, emojiId), { auth, signal });
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches an activity instance of an application
|
||||
*
|
||||
* @see {@link https://docs.discord.com/developers/resources/application#get-application-activity-instance}
|
||||
* @param applicationId - The id of the application to fetch the activity instance of
|
||||
* @param instanceId - The id of the activity instance to fetch
|
||||
* @param options - The options for fetching the activity instance
|
||||
*/
|
||||
public async getActivityInstance(
|
||||
applicationId: Snowflake,
|
||||
instanceId: string,
|
||||
{ auth, signal }: Pick<RequestData, 'auth' | 'signal'> = {},
|
||||
) {
|
||||
return this.rest.get(Routes.applicationActivityInstance(applicationId, instanceId), {
|
||||
auth,
|
||||
signal,
|
||||
}) as Promise<RESTGetAPIApplicationActivityInstanceResult>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user