Skip to content

Commit

Permalink
Fix merge methods for AppCommandContext and AppInstallationType
Browse files Browse the repository at this point in the history
  • Loading branch information
JeronimusII committed May 18, 2024
1 parent b9dc85e commit b5ada0a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions discord/app_commands/installs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def user(self, value: bool) -> None:
def merge(self, other: AppInstallationType) -> AppInstallationType:
# Merging is similar to AllowedMentions where `self` is the base
# and the `other` is the override preference
guild = self.guild if other.guild is None else other.guild
user = self.user if other.user is None else other.user
guild = self._guild if other._guild is None else other._guild
user = self._user if other._user is None else other._user
return AppInstallationType(guild=guild, user=user)

def _is_unset(self) -> bool:
Expand Down Expand Up @@ -170,9 +170,9 @@ def private_channel(self, value: bool) -> None:
self._private_channel = bool(value)

def merge(self, other: AppCommandContext) -> AppCommandContext:
guild = self.guild if other.guild is None else other.guild
dm_channel = self.dm_channel if other.dm_channel is None else other.dm_channel
private_channel = self.private_channel if other.private_channel is None else other.private_channel
guild = self._guild if other._guild is None else other._guild
dm_channel = self._dm_channel if other._dm_channel is None else other._dm_channel
private_channel = self._private_channel if other._private_channel is None else other._private_channel
return AppCommandContext(guild=guild, dm_channel=dm_channel, private_channel=private_channel)

def _is_unset(self) -> bool:
Expand Down

0 comments on commit b5ada0a

Please sign in to comment.