Skip to content

Commit

Permalink
Hotfix: Removed nextcord version check, Added handling for member lea…
Browse files Browse the repository at this point in the history
…ving guild joined_at
  • Loading branch information
mahtoid committed Oct 16, 2022
1 parent e0af6bb commit eef9c9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chat_exporter/construct/assets/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


def _gather_checker():
if hasattr(discord.Embed, "Empty") and (discord.module != "nextcord" or discord.__version__ < 2.2):
if hasattr(discord.Embed, "Empty") and discord.module != "nextcord":
return discord.Embed.Empty
return None

Expand Down
2 changes: 1 addition & 1 deletion chat_exporter/construct/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def build_meta_data(self):
self.message.author.display_avatar if self.message.author.display_avatar
else DiscordUtils.default_avatar
)
user_joined_at = self.message.author.joined_at
user_joined_at = self.message.author.joined_at if hasattr(self.message.author, "joined_at") else None
user_display_name = (
f'<div class="meta__display-name">{self.message.author.display_name}</div>'
if self.message.author.display_name != self.message.author.name
Expand Down
5 changes: 4 additions & 1 deletion chat_exporter/construct/transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ async def export_transcript(self, message_html: str, meta_data: str):
meta_data_html: str = ""
for data in meta_data:
creation_time = meta_data[int(data)][1].astimezone(timezone).strftime("%b %d, %Y")
joined_time = meta_data[int(data)][5].astimezone(timezone).strftime("%b %d, %Y")
joined_time = (
meta_data[int(data)][5].astimezone(timezone).strftime("%b %d, %Y")
if meta_data[int(data)][5] else "Unknown"
)

meta_data_html += await fill_out(self.channel.guild, meta_data_temp, [
("USER_ID", str(data), PARSE_MODE_NONE),
Expand Down

0 comments on commit eef9c9b

Please sign in to comment.