From 3d7e9f3f63e16079dfab26b242732898b7e81280 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 5 Jun 2025 19:24:58 +0000 Subject: [PATCH] fix log view field section accessory --- cogs/logging_cog.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cogs/logging_cog.py b/cogs/logging_cog.py index 0cb1559..6cc01b3 100644 --- a/cogs/logging_cog.py +++ b/cogs/logging_cog.py @@ -72,10 +72,14 @@ class LoggingCog(commands.Cog): self.header.add_item(ui.TextDisplay(description)) self.container.add_item(self.header) - # Section to hold log fields with no accessory. Using a blank - # TextDisplay avoids ``None`` errors from ``is_dispatchable`` while - # keeping the accessory effectively invisible. - self.fields_section = ui.Section(accessory=ui.TextDisplay("\u200b")) + # Section to hold log fields. `discord.py` requires an accessory of + # type ``Button`` or ``Thumbnail`` for a ``Section``. A disabled + # button with a zero-width label acts as an invisible placeholder + # and prevents ``is_dispatchable`` errors without affecting the + # layout visually. + self.fields_section = ui.Section( + accessory=ui.Button(label="\u200b", disabled=True) + ) self.container.add_item(self.fields_section) self.container.add_item(ui.Separator(spacing=discord.SeparatorSpacing.small))