fix(ranks): Correct overview note creation.
This commit is contained in:
@@ -380,34 +380,6 @@ class RankOverviewUI(MessageUI):
|
|||||||
] or [[]]
|
] or [[]]
|
||||||
lines = line_blocks[self.pagen]
|
lines = line_blocks[self.pagen]
|
||||||
desc = '\n'.join(reversed(lines))
|
desc = '\n'.join(reversed(lines))
|
||||||
|
|
||||||
# Add note about season start
|
|
||||||
note_name = t(_p(
|
|
||||||
'ui:rank_overview|embed|field:note|name',
|
|
||||||
"Note"
|
|
||||||
))
|
|
||||||
season_start = self.lguild.data.season_start
|
|
||||||
if season_start:
|
|
||||||
season_str = t(_p(
|
|
||||||
'ui:rank_overview|embed|field:note|value:with_season',
|
|
||||||
"Ranks are determined by activity since {timestamp}."
|
|
||||||
)).format(
|
|
||||||
timestamp=discord.utils.format_dt(season_start)
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
season_str = t(_p(
|
|
||||||
'ui:rank_overview|embed|field:note|value:without_season',
|
|
||||||
"Ranks are determined by *all-time* statistics.\n"
|
|
||||||
"To reward ranks from a later time (e.g. to have monthly/quarterly/yearly ranks) "
|
|
||||||
"set the `season_start` with {stats_cmd}"
|
|
||||||
)).format(stats_cmd=self.bot.core.mention_cmd('configure statistics'))
|
|
||||||
if self.rank_type is RankType.VOICE:
|
|
||||||
addendum = t(_p(
|
|
||||||
'ui:rank_overview|embed|field:note|value|voice_addendum',
|
|
||||||
"Also note that ranks will only be updated when a member leaves a tracked voice channel! "
|
|
||||||
"Use the **Refresh Member Ranks** button below to update all members manually."
|
|
||||||
))
|
|
||||||
season_str = '\n'.join((season_str, addendum))
|
|
||||||
else:
|
else:
|
||||||
# No ranks, give hints about adding ranks
|
# No ranks, give hints about adding ranks
|
||||||
desc = t(_p(
|
desc = t(_p(
|
||||||
@@ -439,6 +411,33 @@ class RankOverviewUI(MessageUI):
|
|||||||
description=desc
|
description=desc
|
||||||
)
|
)
|
||||||
if show_note:
|
if show_note:
|
||||||
|
# Add note about season start
|
||||||
|
note_name = t(_p(
|
||||||
|
'ui:rank_overview|embed|field:note|name',
|
||||||
|
"Note"
|
||||||
|
))
|
||||||
|
season_start = self.lguild.data.season_start
|
||||||
|
if season_start:
|
||||||
|
season_str = t(_p(
|
||||||
|
'ui:rank_overview|embed|field:note|value:with_season',
|
||||||
|
"Ranks are determined by activity since {timestamp}."
|
||||||
|
)).format(
|
||||||
|
timestamp=discord.utils.format_dt(season_start)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
season_str = t(_p(
|
||||||
|
'ui:rank_overview|embed|field:note|value:without_season',
|
||||||
|
"Ranks are determined by *all-time* statistics.\n"
|
||||||
|
"To reward ranks from a later time (e.g. to have monthly/quarterly/yearly ranks) "
|
||||||
|
"set the `season_start` with {stats_cmd}"
|
||||||
|
)).format(stats_cmd=self.bot.core.mention_cmd('configure statistics'))
|
||||||
|
if self.rank_type is RankType.VOICE:
|
||||||
|
addendum = t(_p(
|
||||||
|
'ui:rank_overview|embed|field:note|value|voice_addendum',
|
||||||
|
"Also note that ranks will only be updated when a member leaves a tracked voice channel! "
|
||||||
|
"Use the **Refresh Member Ranks** button below to update all members manually."
|
||||||
|
))
|
||||||
|
season_str = '\n'.join((season_str, addendum))
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name=note_name,
|
name=note_name,
|
||||||
value=season_str,
|
value=season_str,
|
||||||
|
|||||||
Reference in New Issue
Block a user