mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-18 01:07:22 +00:00
feat: Add deleteCurrentUserApplicationRoleConnection endpoint (#5230)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user