fix logging view layout
This commit is contained in:
parent
c2a99d6629
commit
b70efe4735
@ -137,8 +137,8 @@ class LoggingCog(commands.Cog):
|
||||
ui.Separator(spacing=discord.SeparatorSpacing.small)
|
||||
)
|
||||
|
||||
self.content_container = ui.Container()
|
||||
self.container.add_item(self.content_container)
|
||||
# Avoid nested containers as webhook messages don't support them
|
||||
self.content_container = self.container
|
||||
self.container.add_item(
|
||||
ui.Separator(spacing=discord.SeparatorSpacing.small)
|
||||
)
|
||||
@ -175,6 +175,11 @@ class LoggingCog(commands.Cog):
|
||||
if "User ID:" not in self.footer_display.content:
|
||||
self.footer_display.content += f" | User ID: {user.id}"
|
||||
|
||||
def set_footer(self, text: str) -> None:
|
||||
"""Replace the footer text while preserving the timestamp."""
|
||||
timestamp = discord.utils.format_dt(datetime.datetime.utcnow(), style="f")
|
||||
self.footer_display.content = f"{timestamp} | {text}"
|
||||
|
||||
def _user_display(self, user: Union[discord.Member, discord.User]) -> str:
|
||||
"""Return display name, username and ID string for a user."""
|
||||
display = user.display_name if isinstance(user, discord.Member) else user.name
|
||||
@ -1512,7 +1517,7 @@ class LoggingCog(commands.Cog):
|
||||
# Cannot reliably get inviter after deletion
|
||||
)
|
||||
# Invite object might not have ID after deletion, use code in footer?
|
||||
embed.set_footer(text=f"Invite Code: {invite.code}")
|
||||
embed.set_footer(f"Invite Code: {invite.code}")
|
||||
await self._send_log_embed(guild, embed)
|
||||
|
||||
# --- Bot/Command Events ---
|
||||
@ -2356,7 +2361,7 @@ class LoggingCog(commands.Cog):
|
||||
)
|
||||
|
||||
embed.set_footer(
|
||||
text=f"Audit Log Entry ID: {entry.id} | Moderator ID: {user.id}{target_id_str}"
|
||||
f"Audit Log Entry ID: {entry.id} | Moderator ID: {user.id}{target_id_str}"
|
||||
)
|
||||
|
||||
await self._send_log_embed(guild, embed)
|
||||
|
Loading…
x
Reference in New Issue
Block a user