Skip to content

Commit

Permalink
chore: remove vanity_code from Guild.edit (#2491)
Browse files Browse the repository at this point in the history
chore: remove vanity_code from Guild.edit
  • Loading branch information
Dorukyum committed Jul 7, 2024
1 parent d1702cf commit 73e4e37
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ These changes are available on the `master` branch, but have not yet been releas
- Removed the `oldest_first` parameter from `Guild.audit_logs` in favor of the `before`
and `after` parameters.
([#2371](https://github.com/Pycord-Development/pycord/pull/2371))
- Removed the `vanity_code` parameter from `Guild.edit`.
([#2480](https://github.com/Pycord-Development/pycord/pull/2480))

## [2.5.0] - 2024-03-02

Expand Down
6 changes: 0 additions & 6 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,6 @@ async def edit(
default_notifications: NotificationLevel = MISSING,
verification_level: VerificationLevel = MISSING,
explicit_content_filter: ContentFilter = MISSING,
vanity_code: str = MISSING,
system_channel: TextChannel | None = MISSING,
system_channel_flags: SystemChannelFlags = MISSING,
preferred_locale: str = MISSING,
Expand Down Expand Up @@ -1720,8 +1719,6 @@ async def edit(
The new default notification level for the guild.
explicit_content_filter: :class:`ContentFilter`
The new explicit content filter for the guild.
vanity_code: :class:`str`
The new vanity code for the guild.
system_channel: Optional[:class:`TextChannel`]
The new channel that is used for the system channel. Could be ``None`` for no system channel.
system_channel_flags: :class:`SystemChannelFlags`
Expand Down Expand Up @@ -1764,9 +1761,6 @@ async def edit(

http = self._state.http

if vanity_code is not MISSING:
await http.change_vanity_code(self.id, vanity_code, reason=reason)

fields: dict[str, Any] = {}
if name is not MISSING:
fields["name"] = name
Expand Down
10 changes: 0 additions & 10 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1628,16 +1628,6 @@ def get_vanity_code(self, guild_id: Snowflake) -> Response[invite.VanityInvite]:
Route("GET", "/guilds/{guild_id}/vanity-url", guild_id=guild_id)
)

def change_vanity_code(
self, guild_id: Snowflake, code: str, *, reason: str | None = None
) -> Response[None]:
payload: dict[str, Any] = {"code": code}
return self.request(
Route("PATCH", "/guilds/{guild_id}/vanity-url", guild_id=guild_id),
json=payload,
reason=reason,
)

def get_all_guild_channels(
self, guild_id: Snowflake
) -> Response[list[guild.GuildChannel]]:
Expand Down

0 comments on commit 73e4e37

Please sign in to comment.