new Client
src/client.ts:102new Client(token?: string, options?: ClientOptions)The REST client: one method per Discord endpoint, with automatic ratelimit handling. Methods resolve with the raw JSON Discord sends back.
import { Client } from 'detritus-client-rest';new Client(token?: string, options?: ClientOptions)acceptAgreements(privacy?: boolean, terms?: boolean): Promise<any>acceptInvite(code: string): Promise<any>acceptTeamInvite(token: string): Promise<any>acceptTemplate(templateId: string, options: AcceptTemplate): Promise<any>ackChannelMessage(channelId: string, messageId: string, token: string): Promise<any>ackChannelPins(channelId: string): Promise<any>ackGuild(guildId: string): Promise<any>activateOauth2ApplicationLicense(
applicationId: string,
options: ActivateOauth2ApplicationLicense,
): Promise<any>addConnection(platform: string, accountId: string, options: AddConnection): Promise<any>addGuildMember(guildId: string, userId: string, options: AddGuildMember): Promise<any>addGuildMemberRole(
guildId: string,
userId: string,
roleId: string,
options?: AddGuildMemberRole,
): Promise<any>addInvalidRequest(): voidaddInviteTargetUser(code: string, userId: string): Promise<any>addOauth2ApplicationWhitelistUser(
applicationId: string,
options: AddOauth2ApplicationWhitelistUser,
): Promise<any>addPinnedMessage(channelId: string, messageId: string, options?: PinMessage): Promise<any>addRecipient(channelId: string, userId: string, options?: AddRecipient): Promise<any>addTeamMember(teamId: string, options: AddTeamMember): Promise<any>addThreadMember(channelId: string, userId: string): Promise<any>authorizeIpAddress(options: AuthorizeIpAddress): Promise<any>beginGuildPrune(guildId: string, options?: BeginGuildPrune): Promise<any>bulkAddInviteTargetUsers(code: string, options: BulkAddInviteTargetUsers): Promise<any>bulkDeleteInviteTargetUsers(
code: string,
options: BulkDeleteInviteTargetUsers,
): Promise<any>bulkDeleteMessages(
channelId: string,
messageIds: string[],
options?: BulkDeleteMessages,
): Promise<any>bulkGuildBan(guildId: string, options: BulkGuildBan): Promise<any>bulkOverwriteApplicationCommands(
applicationId: string,
commands: (CreateApplicationCommand | toJSON<CreateApplicationCommandData>)[],
): Promise<any>bulkOverwriteApplicationGuildCommands(
applicationId: string,
guildId: string,
commands: (CreateApplicationGuildCommand | toJSON<CreateApplicationGuildCommandData>)[],
): Promise<any>bulkOverwriteApplicationGuildCommandsPermissions(
applicationId: string,
guildId: string,
permissions: BulkOverwriteApplicationGuildCommandsPermissions,
): Promise<any>bulkOverwriteApplicationRoleConnectionsMetadata(
applicationId: string,
metadata: (BulkOverwriteApplicationRoleConnectionsMetadataRecord | toJSON<BulkOverwriteApplicationRoleConnectionsMetadataRecordData>)[],
): Promise<any>connectionCallback(platform: string, options: ConnectionCallback): Promise<any>consumeApplicationEntitlement(applicationId: string, entitlementId: string): Promise<any>createApplicationCommand(
applicationId: string,
options: CreateApplicationCommand | toJSON<CreateApplicationCommandData>,
): Promise<any>createApplicationEmoji(
applicationId: string,
options: CreateApplicationEmoji,
): Promise<any>createApplicationEntitlement(
applicationId: string,
options: CreateApplicationEntitlement,
): Promise<any>createApplicationGuildCommand(
applicationId: string,
guildId: string,
options: CreateApplicationGuildCommand | toJSON<CreateApplicationGuildCommandData>,
): Promise<any>createApplicationNews(options: CreateApplicationNews): Promise<any>createChannelAttachments(
channelId: string,
options: CreateChannelAttachments,
): Promise<any>createChannelInvite(channelId: string, options?: CreateChannelInvite): Promise<any>createChannelMessageThread(
channelId: string,
messageId: string,
options: CreateChannelMessageThread,
): Promise<any>createChannelStoreListingGrantEntitlement(channelId: string): Promise<any>createChannelThread(channelId: string, options: CreateChannelThread): Promise<any>createDm(options?: CreateDm): Promise<any>createGuild(options: CreateGuild): Promise<any>createGuildAutoModerationRule(
guildId: string,
options: CreateGuildAutoModerationRule,
): Promise<any>createGuildBan(guildId: string, userId: string, options?: CreateGuildBan): Promise<any>createGuildChannel(guildId: string, options: CreateGuildChannel): Promise<any>createGuildEmoji(guildId: string, options: CreateGuildEmoji): Promise<any>createGuildIntegration(guildId: string, options: CreateGuildIntegration): Promise<any>createGuildRole(guildId: string, options?: CreateGuildRole): Promise<any>createGuildScheduledEvent(
guildId: string,
options: CreateGuildScheduledEvent,
): Promise<any>createGuildSoundboardSound(
guildId: string,
options: CreateGuildSoundboardSound,
): Promise<any>createGuildSticker(guildId: string, options: CreateGuildSticker): Promise<any>createGuildTemplate(guildId: string, options: CreateGuildTemplate): Promise<any>createInteractionResponse(
interactionId: string,
token: string,
optionsOrType: number | CreateInteractionResponse,
innerData?: string | CreateInteractionResponseInnerPayload,
withResponse?: boolean,
): Promise<any>createLobby(
applicationIdOrOptions?: string | CreateLobby,
options?: CreateLobby,
): Promise<any>createLobbyChannelInvite(lobbyId: string, userId?: string): Promise<any>createLobbyMessage(lobbyId: string, options: CreateLobbyMessage): Promise<any>createMeBillingPaymentSource(options: CreateMeBillingPaymentSource): Promise<any>createMeBillingSubscription(options: CreateMeBillingSubscription): Promise<any>createMessage(channelId: string, options?: string | CreateMessage): Promise<any>createOauth2Application(options: CreateOauth2Application): Promise<any>createOauth2ApplicationAsset(
applicationId: string,
options: CreateOauth2ApplicationAsset,
): Promise<any>createOauth2ApplicationBot(applicationId: string): Promise<any>createOAuth2Token(options: CreateOauth2Token): Promise<any>createOrJoinLobby(options: CreateOrJoinLobby): Promise<any>createReaction(channelId: string, messageId: string, emoji: string): Promise<any>createStageInstance(options: CreateStageInstance): Promise<any>createStoreApplicationAsset(
applicationId: string,
options?: CreateStoreApplicationAsset,
): Promise<any>createTeam(options?: CreateTeam): Promise<any>createWebhook(channelId: string, options: CreateWebhook): Promise<any>crosspostMessage(channelId: string, messageId: string): Promise<any>deleteAccount(options: DeleteAccount): Promise<any>deleteApplicationCommand(applicationId: string, commandId: string): Promise<any>deleteApplicationEmoji(applicationId: string, emojiId: string): Promise<any>deleteApplicationEntitlement(applicationId: string, entitlementId: string): Promise<any>deleteApplicationGuildCommand(
applicationId: string,
guildId: string,
commandId: string,
): Promise<any>deleteChannel(channelId: string, options?: DeleteChannel): Promise<any>deleteChannelOverwrite(
channelId: string,
overwriteId: string,
options?: DeleteChannelOverwrite,
): Promise<any>deleteConnection(platform: string, accountId: string): Promise<any>deleteGuild(guildId: string, options?: DeleteGuild): Promise<any>deleteGuildAutoModerationRule(
guildId: string,
autoModerationRuleId: string,
options?: DeleteGuildAutoModerationRule,
): Promise<any>deleteGuildEmoji(
guildId: string,
emojiId: string,
options?: DeleteGuildEmoji,
): Promise<any>deleteGuildIntegration(
guildId: string,
integrationId: string,
options?: DeleteGuildIntegration,
): Promise<any>deleteGuildPremiumSubscription(guildId: string, subscriptionId: string): Promise<any>deleteGuildRole(guildId: string, roleId: string, options?: DeleteGuildRole): Promise<any>deleteGuildScheduledEvent(
guildId: string,
scheduledEventId: string,
options?: DeleteGuildScheduledEvent,
): Promise<any>deleteGuildSoundboardSound(
guildId: string,
soundId: string,
options?: DeleteGuildSoundboardSound,
): Promise<any>deleteGuildSticker(
guildId: string,
stickerId: string,
options?: DeleteGuildSticker,
): Promise<any>deleteGuildTemplate(guildId: string, templateId: string): Promise<any>deleteInvite(code: string, options?: DeleteInvite): Promise<any>deleteLobby(lobbyId: string): Promise<any>deleteMeApplicationRoleConnection(applicationId: string): Promise<any>deleteMeBillingPaymentSource(paymentSourceId: string): Promise<any>deleteMeBillingSubscription(subscriptionId: string): Promise<any>deleteMessage(channelId: string, messageId: string, options?: DeleteMessage): Promise<any>deleteOauth2Application(
applicationId: string,
options?: DeleteOauth2Application,
): Promise<any>deleteOauth2ApplicationAsset(applicationId: string, assetId: string): Promise<any>deletePinnedMessage(
channelId: string,
messageId: string,
options?: PinMessage,
): Promise<any>deleteReaction(
channelId: string,
messageId: string,
emoji: string,
userId?: string,
): Promise<any>deleteReactions(channelId: string, messageId: string): Promise<any>deleteReactionsEmoji(channelId: string, messageId: string, emoji: string): Promise<any>deleteRelationship(userId: string): Promise<any>deleteStageInstance(channelId: string, options?: DeleteStageInstance): Promise<any>deleteStoreApplicationAsset(applicationId: string, assetId: string): Promise<any>deleteTeam(teamId: string, options?: DeleteTeam): Promise<any>deleteWebhook(webhookId: string, options?: DeleteWebhook): Promise<any>deleteWebhookToken(
webhookId: string,
webhookToken: string,
options?: DeleteWebhook,
): Promise<any>deleteWebhookTokenMessage(
webhookId: string,
webhookToken: string,
messageId: string,
options?: DeleteWebhookTokenMessage,
): Promise<any>disableAccount(options: DisableAccount): Promise<any>editApplication(options?: EditApplication, applicationId?: string): Promise<any>editApplicationCommand(
applicationId: string,
commandId: string,
options?: Partial<CreateApplicationCommand> | toJSON<Partial<CreateApplicationCommandData>>,
): Promise<any>editApplicationEmoji(
applicationId: string,
emojiId: string,
options?: EditApplicationEmoji,
): Promise<any>editApplicationGuildCommand(
applicationId: string,
guildId: string,
commandId: string,
options?: Partial<CreateApplicationCommand> | toJSON<Partial<CreateApplicationCommandData>>,
): Promise<any>editApplicationGuildCommandPermissions(
applicationId: string,
guildId: string,
commandId: string,
options: EditApplicationGuildCommandPermissions,
): Promise<any>editApplicationNews(newsId: string, options?: EditApplicationNews): Promise<any>editChannel(channelId: string, options?: EditChannel): Promise<any>editChannelOverwrite(
channelId: string,
overwriteId: string,
options?: EditChannelOverwrite,
): Promise<any>editChannelVoiceStatus(channelId: string, options: EditChannelVoiceStatus): Promise<any>editConnection(
platform: string,
accountId: string,
options?: EditConnection,
): Promise<any>editGuild(guildId: string, options?: EditGuild): Promise<any>editGuildAutoModerationRule(
guildId: string,
autoModerationRuleId: string,
options?: EditGuildAutoModerationRule,
): Promise<any>editGuildChannels(
guildId: string,
channels: EditGuildChannels,
options?: EditGuildChannelsExtra,
): Promise<any>editGuildEmoji(guildId: string, emojiId: string, options?: EditGuildEmoji): Promise<any>editGuildIncidentActions(
guildId: string,
options?: EditGuildIncidentActions,
): Promise<any>editGuildIntegration(
guildId: string,
integrationId: string,
options?: EditGuildIntegration,
): Promise<any>editGuildMember(guildId: string, userId: string, options?: EditGuildMember): Promise<any>editGuildMemberVerification(
guildId: string,
options?: EditGuildMemberVerification,
): Promise<any>editGuildMfaLevel(guildId: string, options: EditGuildMfaLevel): Promise<any>editGuildNick(guildId: string, nick: string, options?: EditGuildNick): Promise<any>editGuildOnboarding(guildId: string, options?: EditGuildOnboarding): Promise<any>editGuildRole(guildId: string, roleId: string, options?: EditGuildRole): Promise<any>editGuildRolePositions(
guildId: string,
roles: EditGuildRolePositions,
options?: EditGuildRolePositionsExtra,
): Promise<any>editGuildScheduledEvent(
guildId: string,
scheduledEventId: string,
options: EditGuildScheduledEvent,
): Promise<any>editGuildSoundboardSound(
guildId: string,
soundId: string,
options?: EditGuildSoundboardSound,
): Promise<any>editGuildSticker(
guildId: string,
stickerId: string,
options?: EditGuildSticker,
): Promise<any>editGuildTemplate(
guildId: string,
templateId: string,
options?: EditGuildTemplate,
): Promise<any>editGuildVanity(guildId: string, code: string, options?: EditGuildVanity): Promise<any>editGuildVoiceState(
guildId: string,
userId?: string,
options: EditGuildVoiceState,
): Promise<any>editGuildWelcomeScreen(guildId: string, options?: EditGuildWelcomeScreen): Promise<any>editGuildWidget(guildId: string, options: EditGuildWidget): Promise<any>editInviteTargetUsers(code: string, options: EditInviteTargetUsers): Promise<any>editLobby(lobbyId: string, options?: EditLobby): Promise<any>editLobbyChannelLinking(lobbyId: string, options?: EditLobbyChannelLinking): Promise<any>editLobbyMember(lobbyId: string, userId: string, options?: EditLobbyMember): Promise<any>editLobbyMembersBulk(lobbyId: string, members: EditLobbyMembersBulk): Promise<any>editLobbyMessageModerationMetadata(
lobbyId: string,
messageId: string,
metadata: Record<string, string>,
): Promise<any>editMe(options?: EditMe): Promise<any>editMeApplicationRoleConnection(
applicationId: string,
options?: EditMeApplicationRoleConnection,
): Promise<any>editMeBillingPaymentSource(
paymentSourceId: string,
options?: EditMeBillingPaymentSource,
): Promise<any>editMeBillingSubscription(
subscriptionId: string,
options?: EditMeBillingSubscription,
): Promise<any>editMessage(
channelId: string,
messageId: string,
options?: string | EditMessage,
): Promise<any>editNote(userId: string, note: string): Promise<any>editOauth2Application(
applicationId: string,
options?: EditOauth2Application,
): Promise<any>editRelationship(userId: string, type: number): Promise<any>editSettings(options?: EditSettings): Promise<any>editStageInstance(channelId: string, options?: EditStageInstance): Promise<any>editTeam(teamId: string, options?: EditTeam): Promise<any>editUser(options?: EditMe): Promise<any>editWebhook(webhookId: string, options?: EditWebhook): Promise<any>editWebhookToken(
webhookId: string,
webhookToken: string,
options?: EditWebhookToken,
): Promise<any>editWebhookTokenMessage(
webhookId: string,
webhookToken: string,
messageId: string,
options?: string | EditWebhookTokenMessage,
): Promise<any>enableOauth2ApplicationAssets(applicationId: string): Promise<any>enableOauth2ApplicationRpc(applicationId: string): Promise<any>endChannelPoll(channelId: string, messageId: string): Promise<any>executeWebhook(
webhookId: string,
webhookToken: string,
options?: string | ExecuteWebhook,
compatibleType?: string,
): Promise<any>fetchActivities(): Promise<any>fetchApplication(applicationId: string): Promise<any>fetchApplicationActivityInstance(
applicationId: string,
instanceId: string,
): Promise<ApplicationActivityInstance>fetchApplicationCommand(applicationId: string, commandId: string): Promise<any>fetchApplicationCommands(
applicationId: string,
options?: FetchApplicationCommands,
): Promise<any>fetchApplicationEmoji(applicationId: string, emojiId: string): Promise<any>fetchApplicationEmojis(applicationId: string): Promise<any>fetchApplicationEntitlement(applicationId: string, entitlementId: string): Promise<any>fetchApplicationEntitlements(
applicationId: string,
options?: FetchApplicationEntitlements,
): Promise<any>fetchApplicationGuildCommand(
applicationId: string,
guildId: string,
commandId: string,
): Promise<any>fetchApplicationGuildCommandPermissions(
applicationId: string,
guildId: string,
commandId: string,
): Promise<any>fetchApplicationGuildCommands(
applicationId: string,
guildId: string,
options?: FetchApplicationGuildCommands,
): Promise<any>fetchApplicationGuildCommandsPermissions(
applicationId: string,
guildId: string,
): Promise<any>fetchApplicationNews(applicationIds?: string | string[]): Promise<any>fetchApplicationNewsId(newsId: string): Promise<any>fetchApplicationRoleConnectionsMetadata(applicationId: string): Promise<any>fetchApplications(): Promise<any>fetchApplicationsDetectable(): Promise<any>fetchApplicationSkus(applicationId: string): Promise<any>fetchApplicationsPublic(applicationIds: string | string[]): Promise<any>fetchApplicationsTrendingGlobal(): Promise<any>fetchAuthConsentRequired(): Promise<any>fetchChannel(channelId: string): Promise<any>fetchChannelCall(channelId: string): Promise<any>fetchChannelInvites(channelId: string): Promise<any>fetchChannelPins(channelId: string, options?: FetchChannelPins): Promise<any>fetchChannelPollAnswerVoters(
channelId: string,
messageId: string,
answerId: string,
options?: FetchChannelPollAnswerVoters,
): Promise<any>fetchChannelStoreListing(channelId: string): Promise<any>fetchChannelThreadsActive(
channelId: string,
options?: FetchChannelThreadsActive,
): Promise<any>fetchChannelThreadsArchivedPrivate(
channelId: string,
options?: FetchChannelThreadsArchivedPrivate,
): Promise<any>fetchChannelThreadsArchivedPrivateJoined(
channelId: string,
options?: FetchChannelThreadsArchivedPrivateJoined,
): Promise<any>fetchChannelThreadsArchivedPublic(
channelId: string,
options?: FetchChannelThreadsArchivedPublic,
): Promise<any>fetchChannelWebhooks(channelId: string): Promise<any>fetchConnectionAuthorizeUrl(
platform: string,
options?: FetchConnectionAuthorizeUrl,
): Promise<any>fetchConsentRequired(): Promise<any>fetchDiscoverableGuilds(): Promise<any>fetchDms(userId?: string): Promise<any>fetchEmojiGuild(emojiId: string): Promise<any>fetchExperiments(fingerprint?: string): Promise<any>fetchGateway(): Promise<any>fetchGatewayBot(): Promise<any>fetchGiftCode(code: string, options?: FetchGiftCode): Promise<any>fetchGuild(guildId: string, options?: FetchGuild): Promise<any>fetchGuildApplications(guildId: string, channelId?: string): Promise<any>fetchGuildAuditLogs(guildId: string, options?: FetchGuildAuditLogs): Promise<any>fetchGuildAutoModerationRule(guildId: string, autoModerationRuleId: string): Promise<any>fetchGuildAutoModerationRules(guildId: string): Promise<any>fetchGuildBan(guildId: string, userId: string): Promise<any>fetchGuildBans(guildId: string, options?: FetchGuildBans): Promise<any>fetchGuildChannels(guildId: string): Promise<any>fetchGuildEmoji(guildId: string, emojiId: string): Promise<any>fetchGuildEmojis(guildId: string): Promise<any>fetchGuildIntegrations(guildId: string): Promise<any>fetchGuildInvites(guildId: string): Promise<any>fetchGuildMember(guildId: string, userId: string): Promise<any>fetchGuildMembers(guildId: string, options?: FetchGuildMembers): Promise<any>fetchGuildMembersSearch(guildId: string, options: FetchGuildMembersSearch): Promise<any>fetchGuildMemberVerification(guildId: string): Promise<any>fetchGuildOnboarding(guildId: string): Promise<any>fetchGuildPremiumSubscriptions(guildId: string): Promise<any>fetchGuildPreview(guildId: string): Promise<any>fetchGuildPruneCount(guildId: string, options?: FetchGuildPruneCount): Promise<any>fetchGuildRole(guildId: string, roleId: string): Promise<any>fetchGuildRoleMemberCounts(guildId: string): Promise<any>fetchGuildRoles(guildId: string): Promise<any>fetchGuildScheduledEvent(
guildId: string,
scheduledEventId: string,
options?: FetchGuildScheduledEvent,
): Promise<any>fetchGuildScheduledEvents(
guildId: string,
options?: FetchGuildScheduledEvents,
): Promise<any>fetchGuildScheduledEventUsers(
guildId: string,
scheduledEventId: string,
options?: FetchGuildScheduledEventUsers,
): Promise<any>fetchGuildSoundboardSound(guildId: string, soundId: string): Promise<any>fetchGuildSoundboardSounds(guildId: string): Promise<any>fetchGuildSticker(guildId: string, stickerId: string): Promise<any>fetchGuildStickers(guildId: string): Promise<any>fetchGuildTemplates(guildId: string): Promise<any>fetchGuildThreadsActive(guildId: string): Promise<any>fetchGuildVanityUrl(guildId: string): Promise<any>fetchGuildVoiceState(guildId: string, userId?: string): Promise<any>fetchGuildWebhooks(guildId: string): Promise<any>fetchGuildWelcomeScreen(guildId: string): Promise<any>fetchGuildWidget(guildId: string): Promise<any>fetchGuildWidgetJson(guildId: string): Promise<any>fetchGuildWidgetPng(guildId: string, options?: FetchGuildWidgetPng): Promise<any>fetchInvite(code: string, options?: FetchInvite): Promise<any>fetchInviteTargetUsers(code: string): Promise<any>fetchInviteTargetUsersJobStatus(code: string): Promise<any>fetchLobby(lobbyId: string): Promise<any>fetchLobbyMessages(lobbyId: string, options?: FetchLobbyMessages): Promise<any>fetchMe(options?: FetchMe): Promise<any>fetchMeApplicationRoleConnection(applicationId: string): Promise<any>fetchMeBillingPayments(options?: FetchMeBillingPayments): Promise<any>fetchMeBillingPaymentSources(): Promise<any>fetchMeBillingSubscriptions(): Promise<any>fetchMeChannels(): Promise<any>fetchMeConnectionAccessToken(platform: string, accountId: string): Promise<any>fetchMeConnections(): Promise<any>fetchMeConnectionSubreddits(accountId: string): Promise<any>fetchMeFeedSettings(options?: FetchMeFeedSettings): Promise<any>fetchMeGuildMember(guildId: string): Promise<any>fetchMeGuilds(options?: FetchMeGuilds): Promise<any>fetchMessage(channelId: string, messageId: string): Promise<any>fetchMessages(channelId: string, options?: FetchMessages): Promise<any>fetchMeStickerPacks(countryCode?: string): Promise<any>fetchOauth2Application(applicationId?: string): Promise<any>fetchOauth2ApplicationAssets(applicationId: string): Promise<any>fetchOauth2Applications(options?: FetchOauth2Applications): Promise<any>fetchOauth2ApplicationWhitelist(applicationId: string): Promise<any>fetchOauth2Authorize(options?: FetchOauth2Authorize): Promise<any>fetchOauth2AuthorizeWebhookChannels(guildId: string): Promise<any>fetchOauth2Token(tokenId: string): Promise<any>fetchOauth2Tokens(): Promise<any>fetchPinnedMessages(channelId: string): Promise<any>Deprecated. use fetchChannelPins, this route is deprecated and capped at 50 pins
fetchReactions(
channelId: string,
messageId: string,
emoji: string,
options?: FetchReactions,
): Promise<any>fetchSkuSubscription(skuId: string, subscriptionId: string): Promise<any>fetchSkuSubscriptions(skuId: string, options?: FetchSkuSubscriptions): Promise<any>fetchSoundboardDefaultSounds(): Promise<any>fetchStageInstance(channelId: string): Promise<any>fetchSticker(stickerId: string): Promise<any>fetchStickerPack(stickerPackId: string): Promise<any>fetchStickerPacks(): Promise<any>fetchStoreApplicationAssets(applicationId: string): Promise<any>fetchStorePublishedListingsSku(skuId: string): Promise<any>fetchStorePublishedListingsSkus(applicationId: string): Promise<any>fetchStorePublishedListingsSkuSubscriptionPlans(skuId: string): Promise<any>fetchStreamPreview(streamKey: string): Promise<any>fetchTeam(teamId: string): Promise<any>fetchTeamApplications(teamId: string): Promise<any>fetchTeamMember(teamId: string, userId: string): Promise<any>fetchTeamMembers(teamId: string): Promise<any>fetchTeamPayouts(teamId: string, options?: FetchTeamPayouts): Promise<any>fetchTeams(): Promise<any>fetchTemplate(templateId: string): Promise<any>fetchThreadMember(
channelId: string,
userId: string,
options?: FetchThreadMember,
): Promise<any>fetchThreadMembers(channelId: string, options?: FetchThreadMembers): Promise<any>fetchUser(userId: string): Promise<any>fetchUserActivityMetadata(
userId: string,
sessionId: string,
activityId: string,
): Promise<any>fetchUserChannels(userId: string): Promise<any>fetchUserProfile(userId: string): Promise<any>fetchVoiceIce(): Promise<any>fetchVoiceRegions(guildId?: string): Promise<any>fetchWebhook(webhookId: string): Promise<any>fetchWebhookToken(webhookId: string, webhookToken: string): Promise<any>fetchWebhookTokenMessage(
webhookId: string,
webhookToken: string,
messageId: string,
options?: FetchWebhookTokenMessage,
): Promise<any>followChannel(channelId: string, options: FollowChannel): Promise<any>forgotPassword(options: ForgotPassword): Promise<any>integrationJoin(integrationId: string): Promise<any>joinGuild(guildId: string, options?: JoinGuild): Promise<any>joinThread(channelId: string): Promise<any>leaveGuild(guildId: string): Promise<any>leaveLobby(lobbyId: string): Promise<any>leaveThread(channelId: string): Promise<any>login(options: Login): Promise<any>loginMfaSms(options: LoginMfaSms): Promise<any>loginMfaSmsSend(options: LoginMfaSmsSend): Promise<any>loginMfaTotp(options: LoginMfaTotp): Promise<any>logout(options?: Logout): Promise<any>oauth2Authorize(options?: Oauth2Authorize): Promise<any>on(event: string | symbol, listener: (...args: any[]) => void): thisAdds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
server.on('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// aThe callback function
on(event: "request", listener: (payload: RequestPayload) => any): thison(event: "response", listener: (payload: ResponsePayload) => any): thispruneInvalidRequests(): voidredeemGiftCode(code: string, options?: RedeemGiftCode): Promise<any>register(options: Register): Promise<any>removeGuildBan(guildId: string, userId: string, options?: RemoveGuildBan): Promise<any>removeGuildMember(
guildId: string,
userId: string,
options?: RemoveGuildMember,
): Promise<any>removeGuildMemberRole(
guildId: string,
userId: string,
roleId: string,
options?: RemoveGuildMemberRole,
): Promise<any>removeInviteTargetUser(code: string, userId: string): Promise<any>removeLobbyMember(lobbyId: string, userId?: string): Promise<any>removeMention(messageId: string): Promise<any>removeOauth2ApplicationWhitelistUser(applicationId: string, userId: string): Promise<any>removeRecipient(channelId: string, userId: string): Promise<any>removeTeamMember(teamId: string, userId: string): Promise<any>removeThreadMember(channelId: string, userId: string): Promise<any>resetOauth2Application(applicationId: string): Promise<any>resetOauth2ApplicationBot(applicationId: string): Promise<any>resetPassword(options: ResetPassword): Promise<any>resetPasswordMfa(options: ResetPasswordMfa): Promise<any>search(
searchType: "channel" | "guild",
searchId: string,
options?: SearchOptions,
retry?: boolean,
retryNumber?: number,
): Promise<any>searchChannel(
channelId: string,
options?: SearchOptions,
retry?: boolean,
retryNumber?: number,
): Promise<any>searchGuild(
guildId: string,
options?: SearchOptions,
retry?: boolean,
retryNumber?: number,
): Promise<any>searchLobbies(applicationId: string, options?: SearchLobbies): Promise<any>Deprecated. old GameSDK lobbies, this endpoint doesn't exist anymore
sendDownloadText(number: string): Promise<any>sendFriendRequest(options: SendFriendRequest): Promise<any>sendLobbyData(lobbyId: string, data: string): Promise<any>Deprecated. old GameSDK lobbies, use createLobbyMessage
sendSoundboardSound(channelId: string, options: SendSoundboardSound): Promise<any>setAuthType(type: string): voidstartChannelCallRinging(
channelId: string,
options?: StartChannelCallRinging,
): Promise<any>stopChannelCallRinging(channelId: string, options?: StopChannelCallRinging): Promise<any>submitConnectionPinCode(platform: string, pin: string): Promise<any>submitOauth2ApplicationApproval(applicationId: string): Promise<any>syncGuildIntegration(guildId: string, integrationId: string): Promise<any>syncGuildTemplate(guildId: string, templateId: string): Promise<any>transferOauth2Application(
applicationId: string,
options: TransferOauth2Application,
): Promise<any>triggerTyping(channelId: string): Promise<any>unAckChannel(channelId: string): Promise<any>verify(options: Verify): Promise<any>verifyCaptcha(options: VerifyCaptcha): Promise<any>verifyResend(): Promise<any>