mirror of https://gitlab.com/litecord/litecord.git
pubsub.lazy_guild: handle unknown role on role_pos_update
- pubsub.lazy_guild: handle item_index being None on resync_by_item
This commit is contained in:
parent
e38cb38e5f
commit
38b01600aa
|
|
@ -595,6 +595,9 @@ class GuildMemberList:
|
||||||
|
|
||||||
async def resync_by_item(self, item_index: int):
|
async def resync_by_item(self, item_index: int):
|
||||||
"""Resync but only giving the item index."""
|
"""Resync but only giving the item index."""
|
||||||
|
if item_index is None:
|
||||||
|
return []
|
||||||
|
|
||||||
return await self.resync(
|
return await self.resync(
|
||||||
self.get_subs(item_index),
|
self.get_subs(item_index),
|
||||||
item_index
|
item_index
|
||||||
|
|
@ -974,6 +977,11 @@ class GuildMemberList:
|
||||||
role_id = int(role['id'])
|
role_id = int(role['id'])
|
||||||
|
|
||||||
old_index = self.get_group_item_index(role_id)
|
old_index = self.get_group_item_index(role_id)
|
||||||
|
|
||||||
|
if not old_index:
|
||||||
|
log.warning('lazy role_pos_update: unknown group {}', role_id)
|
||||||
|
return
|
||||||
|
|
||||||
old_sessions = list(self.get_subs(old_index))
|
old_sessions = list(self.get_subs(old_index))
|
||||||
|
|
||||||
groups_idx = self._get_role_as_group_idx(role_id)
|
groups_idx = self._get_role_as_group_idx(role_id)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue