This commit is contained in:
Klemek
2021-05-19 13:33:15 +02:00
parent 516eb75b5c
commit da5e3fdb35
7 changed files with 47 additions and 23 deletions
+1 -3
View File
@@ -131,8 +131,6 @@ class ChannelLogs:
yield len(self.messages), True
def dict(self) -> dict:
channel = serialize(
self, not_serialized=["channel", "guild", "start_date"]
)
channel = serialize(self, not_serialized=["channel", "guild", "start_date"])
channel["messages"] = [message.dict() for message in self.messages]
return channel
+1 -2
View File
@@ -76,14 +76,13 @@ class MessageLog:
self.reactions[str(reaction.emoji)] = []
async for user in reaction.users():
self.reactions[str(reaction.emoji)] += [user.id]
async def fetch(self) -> Optional[discord.Message]:
try:
return await self.channel.channel.fetch_message(self.id)
except (discord.NotFound, discord.Forbidden, discord.HTTPException):
return None
def dict(self) -> dict:
return serialize(
self, not_serialized=["channel"], dates=["created_at", "edited_at"]