mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-06 10:02:01 +00:00
Fix merge methods for AppCommandContext and AppInstallationType
This commit is contained in:
parent
b9dc85e6f7
commit
b5ada0a662
@ -78,8 +78,8 @@ class AppInstallationType:
|
|||||||
def merge(self, other: AppInstallationType) -> AppInstallationType:
|
def merge(self, other: AppInstallationType) -> AppInstallationType:
|
||||||
# Merging is similar to AllowedMentions where `self` is the base
|
# Merging is similar to AllowedMentions where `self` is the base
|
||||||
# and the `other` is the override preference
|
# and the `other` is the override preference
|
||||||
guild = self.guild if other.guild is None else other.guild
|
guild = self._guild if other._guild is None else other._guild
|
||||||
user = self.user if other.user is None else other.user
|
user = self._user if other._user is None else other._user
|
||||||
return AppInstallationType(guild=guild, user=user)
|
return AppInstallationType(guild=guild, user=user)
|
||||||
|
|
||||||
def _is_unset(self) -> bool:
|
def _is_unset(self) -> bool:
|
||||||
@ -170,9 +170,9 @@ class AppCommandContext:
|
|||||||
self._private_channel = bool(value)
|
self._private_channel = bool(value)
|
||||||
|
|
||||||
def merge(self, other: AppCommandContext) -> AppCommandContext:
|
def merge(self, other: AppCommandContext) -> AppCommandContext:
|
||||||
guild = self.guild if other.guild is None else other.guild
|
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
|
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
|
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)
|
return AppCommandContext(guild=guild, dm_channel=dm_channel, private_channel=private_channel)
|
||||||
|
|
||||||
def _is_unset(self) -> bool:
|
def _is_unset(self) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user