fix(bot): 🐛 Message logs not working.

This commit is contained in:
Nyeki.py
2024-10-18 14:13:40 -03:00
parent 71afe924e0
commit 77d34beb32
2 changed files with 11 additions and 4 deletions
+7 -2
View File
@@ -463,7 +463,9 @@ class Calls(base.Cog):
)
await self.bot.redis.srem(
constants.CHANNELS_ONCALL_SET, str(channel_id), str(other_channel.id)
constants.CHANNELS_ONCALL_SET,
[str(channel_id)]
+ ([str(other_channel.id)] if other_channel is not None else []),
)
if other_channel is not None:
@@ -481,7 +483,10 @@ class Calls(base.Cog):
channel.call = None
await models.Channel.bulk_update([channel] + ([other_channel] if other_channel is not None else []), ["call_id"])
await models.Channel.bulk_update(
[channel] + ([other_channel] if other_channel is not None else []),
["call_id"],
)
call.ended_at = datetime.now(timezone.utc)
await call.save()
+4 -2
View File
@@ -100,7 +100,9 @@ class ReportView(discord.ui.View):
self.add_item(actions)
self.add_item(
discord.ui.Button(label=f"Remaining: {remaining_reports}", disabled=True, row=2)
discord.ui.Button(
label=f"Remaining: {remaining_reports}", disabled=True, row=2
)
)
@discord.ui.button(label="Message Logs", style=discord.ButtonStyle.gray, row=2)
@@ -137,7 +139,7 @@ class ReportView(discord.ui.View):
logs.append(current_block)
current_block = ""
current_block += f"{"+" if message.channel_id == reporter_channel_id else "-"} {profiles_mapping[message.profile_id].name}:"
current_block += f"{"+" if message.channel_id == reporter_channel_id else "-"} {profiles_mapping[message.profile_id].name if message.profile_id in profiles_mapping else "Unknown"}:"
for content in message.contents:
current_block += (