remove recipient filtering from dm channels

This commit is contained in:
Luna 2021-06-25 17:51:15 -03:00
parent a65f9a9565
commit 03d470dbe7
1 changed files with 0 additions and 12 deletions

View File

@ -63,12 +63,6 @@ def bool_(val):
return maybe(int, val) return maybe(int, val)
def _filter_recipients(recipients: List[Dict[str, Any]], user_id: str):
"""Filter recipients in a list of recipients, removing
the one that is reundant (ourselves)."""
return list(filter(lambda recipient: recipient["id"] != user_id, recipients))
class EmojiStats(TypedDict): class EmojiStats(TypedDict):
count: int count: int
me: bool me: bool
@ -1212,12 +1206,6 @@ class Storage:
async def get_dm(self, dm_id: int, user_id: Optional[int] = None) -> Optional[Dict]: async def get_dm(self, dm_id: int, user_id: Optional[int] = None) -> Optional[Dict]:
"""Get a DM channel.""" """Get a DM channel."""
dm_chan = await self.get_channel(dm_id) dm_chan = await self.get_channel(dm_id)
if user_id and dm_chan:
dm_chan["recipients"] = _filter_recipients(
dm_chan["recipients"], str(user_id)
)
return dm_chan return dm_chan
async def guild_from_channel(self, channel_id: int) -> int: async def guild_from_channel(self, channel_id: int) -> int: