Merge pull request #4 from Slipstreamm/codex/fix-nonetype-error-in-on_message_delete
Fix log embed header accessory
This commit is contained in:
commit
2d8abfa479
@ -64,11 +64,7 @@ class LoggingCog(commands.Cog):
|
||||
super().__init__(timeout=None)
|
||||
self.container = ui.Container(accent_colour=color)
|
||||
self.add_item(self.container)
|
||||
|
||||
# Header section with a thumbnail if author is provided. Otherwise
|
||||
# use a disabled button as a placeholder accessory to satisfy the
|
||||
# API requirement that a section accessory must be a dispatchable
|
||||
# component.
|
||||
|
||||
self.header = ui.Section(
|
||||
accessory=(
|
||||
ui.Thumbnail(media=author.display_avatar.url)
|
||||
@ -111,8 +107,6 @@ class LoggingCog(commands.Cog):
|
||||
if icon_url:
|
||||
self.header.accessory = ui.Thumbnail(media=icon_url)
|
||||
else:
|
||||
# Provide a disabled button as a fallback accessory to keep the
|
||||
# section dispatchable when no icon is supplied.
|
||||
self.header.accessory = ui.Button(label="\u200b", disabled=True)
|
||||
self.header.add_item(ui.TextDisplay(name))
|
||||
def _user_display(self, user: Union[discord.Member, discord.User]) -> str:
|
||||
|
Loading…
x
Reference in New Issue
Block a user