Skip to content

Commit

Permalink
chore: remove editGuildVanity (abalabahaha#18)
Browse files Browse the repository at this point in the history
* Removed editGuildVanity

The vanity endpoint was disabled for bots

```
{
    "message": "Bots cannot use this endpoint",
    "code": 20001
}
```

* remove Guild#editVanity

* update TSDs appropriately

Co-authored-by: Lars_und_so <46791248+Larsundso@users.noreply.github.com>
  • Loading branch information
TTtie and Larsundso authored Dec 16, 2022
1 parent 22a12e7 commit ff9a4db
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
2 changes: 0 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,6 @@ declare namespace Dysnomia {
editGuildScheduledEvent<T extends GuildScheduledEventEntityTypes>(guildID: string, eventID: string, event: GuildScheduledEventEditOptions<T>, reason?: string): Promise<GuildScheduledEvent<T>>;
editGuildSticker(guildID: string, stickerID: string, options?: EditStickerOptions, reason?: string): Promise<Sticker>;
editGuildTemplate(guildID: string, code: string, options: GuildTemplateOptions): Promise<GuildTemplate>;
editGuildVanity(guildID: string, code: string | null): Promise<GuildVanity>;
editGuildVoiceState(guildID: string, options: VoiceStateOptions, userID?: string): Promise<void>;
editGuildWelcomeScreen(guildID: string, options: WelcomeScreenOptions): Promise<WelcomeScreen>;
editGuildWidget(guildID: string, options: Widget): Promise<Widget>;
Expand Down Expand Up @@ -3032,7 +3031,6 @@ declare namespace Dysnomia {
editScheduledEvent<T extends GuildScheduledEventEntityTypes>(eventID: string, event: GuildScheduledEventEditOptions<T>, reason?: string): Promise<GuildScheduledEvent<T>>;
editSticker(stickerID: string, options?: EditStickerOptions, reason?: string): Promise<Sticker>;
editTemplate(code: string, options: GuildTemplateOptions): Promise<GuildTemplate>;
editVanity(code: string | null): Promise<GuildVanity>;
editVoiceState(options: VoiceStateOptions, userID?: string): Promise<void>;
editWelcomeScreen(options: WelcomeScreenOptions): Promise<WelcomeScreen>;
editWidget(options: Widget): Promise<Widget>;
Expand Down
12 changes: 0 additions & 12 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1594,18 +1594,6 @@ class Client extends EventEmitter {
return this.requestHandler.request("PATCH", Endpoints.GUILD_TEMPLATE_GUILD(guildID, code), true, options).then((template) => new GuildTemplate(template, this));
}

/**
* Modify a guild's vanity code
* @arg {String} guildID The ID of the guild
* @arg {String?} code The new vanity code
* @returns {Promise<Object>}
*/
editGuildVanity(guildID, code) {
return this.requestHandler.request("PATCH", Endpoints.GUILD_VANITY_URL(guildID), true, {
code
});
}

/**
* Update a user's voice state - See [caveats](https://discord.com/developers/docs/resources/guild#modify-user-voice-state-caveats)
* @arg {String} guildID The ID of the guild
Expand Down
9 changes: 0 additions & 9 deletions lib/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,15 +853,6 @@ class Guild extends Base {
return this._client.editGuildTemplate.call(this._client, this.id, code, options);
}

/**
* Modify the guild's vanity code
* @arg {String?} code The new vanity code
* @returns {Promise<Object>}
*/
editVanity(code) {
return this._client.editGuildVanity.call(this._client, this.id, code);
}

/**
* Update a user's voice state - See [caveats](https://discord.com/developers/docs/resources/guild#modify-user-voice-state-caveats)
* @arg {Object} options The properties to edit
Expand Down

0 comments on commit ff9a4db

Please sign in to comment.