Update message references in AutoShardedConnectionState

Fixes #5133
This commit is contained in:
Rapptz
2020-07-23 00:17:22 -04:00
parent d37b91dfc6
commit ec3c3eb4c6
2 changed files with 31 additions and 0 deletions

View File

@ -524,6 +524,14 @@ class Message:
call['participants'] = participants
self.call = CallMessage(message=self, **call)
def _rebind_channel_reference(self, new_channel):
self.channel = new_channel
try:
del self._cs_guild
except AttributeError:
pass
@utils.cached_slot_property('_cs_guild')
def guild(self):
"""Optional[:class:`Guild`]: The guild that the message belongs to, if applicable."""