feat: Add deleteCurrentUserApplicationRoleConnection endpoint (#5230)

This commit is contained in:
Fleny
2026-07-29 11:30:08 +05:30
committed by GitHub
parent 57c1a0191a
commit fa338e6447
3 changed files with 25 additions and 0 deletions
+4
View File
@@ -746,6 +746,9 @@ export function createBotHelpers<TProps extends TransformersDesiredProperties, T
editUserApplicationRoleConnection: async (bearerToken, applicationId, options) => {
return await bot.rest.editUserApplicationRoleConnection(bearerToken, applicationId, options);
},
deleteCurrentUserApplicationRoleConnection: async (bearerToken, applicationId) => {
return await bot.rest.deleteCurrentUserApplicationRoleConnection(bearerToken, applicationId);
},
joinThread: async (channelId) => {
return await bot.rest.joinThread(channelId);
},
@@ -982,6 +985,7 @@ export type BotHelpers<TProps extends TransformersDesiredProperties, TBehavior e
applicationId: BigString,
options: Camelize<DiscordApplicationRoleConnection>,
) => Promise<Camelize<DiscordApplicationRoleConnection>>;
deleteCurrentUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString) => Promise<void>;
executeWebhook: (
webhookId: BigString,
token: string,
+9
View File
@@ -1781,6 +1781,15 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
});
},
async deleteCurrentUserApplicationRoleConnection(bearerToken, applicationId) {
return await rest.delete(rest.routes.oauth2.roleConnections(applicationId), {
headers: {
authorization: `Bearer ${bearerToken}`,
},
unauthorized: true,
});
},
async addGuildMember(guildId, userId, body) {
return await rest.put(rest.routes.guilds.members.member(guildId, userId), {
body,
+12
View File
@@ -1460,6 +1460,18 @@ export interface RestManager {
applicationId: BigString,
options: Camelize<DiscordApplicationRoleConnection>,
) => Promise<Camelize<DiscordApplicationRoleConnection>>;
/**
* Deletes the application role connection for the user.
*
* @param bearerToken - The access token of the user
* @param applicationId - The id of the application to delete the role connection
*
* @remarks
* This requires the `role_connections.write` scope.
*
* @see {@link https://docs.discord.com/developers/resources/user#delete-current-user-application-role-connection}
*/
deleteCurrentUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString) => Promise<void>;
/**
* Edits a webhook.
*