Skip to content

Commit

Permalink
Add botBannerURL to edit current bot banner (#3620)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleny113 committed May 26, 2024
1 parent f8f976a commit c6ca749
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/rest/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,13 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage

async editBotProfile(options) {
const avatar = options?.botAvatarURL ? await urlToBase64(options?.botAvatarURL) : options?.botAvatarURL
const banner = options?.botBannerURL ? await urlToBase64(options?.botBannerURL) : options?.botBannerURL

return await rest.patch<DiscordUser>(rest.routes.currentUser(), {
body: {
username: options.username?.trim(),
avatar,
banner,
},
})
},
Expand Down
4 changes: 2 additions & 2 deletions packages/rest/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1030,10 +1030,10 @@ export interface RestManager {
reason?: string,
) => Promise<CamelizedDiscordAutoModerationRule>
/**
* Modifies the bot's username or avatar.
* Modifies the bot's username, avatar or banner.
* NOTE: username: if changed may cause the bot's discriminator to be randomized.
*/
editBotProfile: (options: { username?: string; botAvatarURL?: string | null }) => Promise<CamelizedDiscordUser>
editBotProfile: (options: { username?: string; botAvatarURL?: string | null; botBannerURL?: string | null }) => Promise<CamelizedDiscordUser>
/**
* Edits a channel's settings.
*
Expand Down

0 comments on commit c6ca749

Please sign in to comment.