fix (config): Control dash field lengths.

This commit is contained in:
2023-08-28 22:04:36 +03:00
parent 778e42ba1b
commit 5a152e9be7
5 changed files with 75 additions and 7 deletions

View File

@@ -300,7 +300,6 @@ class DashboardSection:
commands=self.bot.core.mention_cache
)
async def load(self):
"""
Initialise the contained settings.
@@ -322,9 +321,18 @@ class DashboardSection:
# TODO: Header/description field
table = self.make_table()
if len(table) > 1024:
value = t(_p(
'ui:dashboard|error:section_too_long',
"Oops, the settings in this configuration section are too large, "
"and I can not display them here! "
"Please view the settings in the linked configuration panel instead."
))
else:
value = table
page.add_field(
name=t(self.section_name).format(bot=self.bot, commands=self.bot.core.mention_cache),
value=table,
value=value,
inline=False
)