tweak(timer): Make warning more obvious.
This commit is contained in:
@@ -372,11 +372,6 @@ class Timer:
|
|||||||
sending a new status message, pinging members, running the voice alert,
|
sending a new status message, pinging members, running the voice alert,
|
||||||
and kicking inactive members if `kick` is True.
|
and kicking inactive members if `kick` is True.
|
||||||
"""
|
"""
|
||||||
if not self.members:
|
|
||||||
t = self.bot.translator.t
|
|
||||||
await self.stop(auto_restart=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
async with self._lock:
|
async with self._lock:
|
||||||
tasks = []
|
tasks = []
|
||||||
after_tasks = []
|
after_tasks = []
|
||||||
@@ -532,7 +527,7 @@ class Timer:
|
|||||||
if needs_warning:
|
if needs_warning:
|
||||||
warningline = t(_p(
|
warningline = t(_p(
|
||||||
'timer|status|warningline',
|
'timer|status|warningline',
|
||||||
"**Warning:** {mentions}, please press {tick} to avoid being removed on the next stage."
|
"**Please press {tick} to avoid being removed on the next stage.**\n{mentions}"
|
||||||
)).format(
|
)).format(
|
||||||
mentions=' '.join(member.mention for member in needs_warning),
|
mentions=' '.join(member.mention for member in needs_warning),
|
||||||
tick=self.bot.config.emojis.tick
|
tick=self.bot.config.emojis.tick
|
||||||
@@ -547,17 +542,27 @@ class Timer:
|
|||||||
if notifyline:
|
if notifyline:
|
||||||
notifyline = f"||{notifyline}||"
|
notifyline = f"||{notifyline}||"
|
||||||
|
|
||||||
content = "\n".join(string for string in (stageline, warningline, notifyline) if string)
|
content = "\n".join(string for string in (stageline, notifyline) if string)
|
||||||
|
if warningline:
|
||||||
|
embed = discord.Embed(
|
||||||
|
colour=discord.Colour.red(),
|
||||||
|
title="Warning",
|
||||||
|
description=warningline
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
embed = None
|
||||||
elif self.auto_restart:
|
elif self.auto_restart:
|
||||||
content = t(_p(
|
content = t(_p(
|
||||||
'timer|status|stopped:auto',
|
'timer|status|stopped:auto',
|
||||||
"Timer stopped! Join {channel} to start the timer."
|
"Timer stopped! Join {channel} to start the timer."
|
||||||
)).format(channel=self.channel.mention)
|
)).format(channel=self.channel.mention)
|
||||||
|
embed = None
|
||||||
else:
|
else:
|
||||||
content = t(_p(
|
content = t(_p(
|
||||||
'timer|status|stopped:manual',
|
'timer|status|stopped:manual',
|
||||||
"Timer stopped! Press `Start` to restart the timer."
|
"Timer stopped! Press `Start` to restart the timer."
|
||||||
)).format(channel=self.channel.mention)
|
)).format(channel=self.channel.mention)
|
||||||
|
embed = None
|
||||||
|
|
||||||
card = await get_timer_card(self.bot, self, stage)
|
card = await get_timer_card(self.bot, self, stage)
|
||||||
await card.render()
|
await card.render()
|
||||||
@@ -569,6 +574,7 @@ class Timer:
|
|||||||
|
|
||||||
return MessageArgs(
|
return MessageArgs(
|
||||||
content=content,
|
content=content,
|
||||||
|
embed=embed,
|
||||||
file=card.as_file(f"pomodoro_{self.data.channelid}.png"),
|
file=card.as_file(f"pomodoro_{self.data.channelid}.png"),
|
||||||
view=ui
|
view=ui
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user