aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-12-25 13:53:08 -0800
committerGravatar MarkKoz <[email protected]>2020-02-12 10:07:46 -0800
commitbba4319f1e9dbad3c4c0a112252d1a0836f5cbc3 (patch)
treed40b43b5219bc27f342b7e7afea640d01a448dff
parentSync: add trace and debug logging (diff)
Sync: keep the mention for all edits of the confirmation prompt
This makes it clearer to users where the notification came from.
-rw-r--r--bot/cogs/sync/syncers.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/bot/cogs/sync/syncers.py b/bot/cogs/sync/syncers.py
index 08da569d8..2ba9a2a3a 100644
--- a/bot/cogs/sync/syncers.py
+++ b/bot/cogs/sync/syncers.py
@@ -43,6 +43,7 @@ class Syncer(abc.ABC):
log.trace(f"Sending {self.name} sync confirmation prompt.")
allowed_emoji = (constants.Emojis.check_mark, constants.Emojis.cross_mark)
+ mention = ""
msg_content = (
f'Possible cache issue while syncing {self.name}s. '
f'More than {self.MAX_DIFF} {self.name}s were changed. '
@@ -65,7 +66,8 @@ class Syncer(abc.ABC):
)
return False
- message = await channel.send(f"<@&{constants.Roles.core_developer}> {msg_content}")
+ mention = f"<@&{constants.Roles.core_developer}> "
+ message = await channel.send(f"{mention}{msg_content}")
else:
await message.edit(content=msg_content)
@@ -98,11 +100,11 @@ class Syncer(abc.ABC):
finally:
if str(reaction) == constants.Emojis.check_mark:
log.trace(f"The {self.name} syncer was confirmed.")
- await message.edit(content=f':ok_hand: {self.name} sync will proceed.')
+ await message.edit(content=f':ok_hand: {mention}{self.name} sync will proceed.')
return True
else:
- log.warning(f"{self.name} syncer aborted or timed out!")
- await message.edit(content=f':x: {self.name} sync aborted or timed out!')
+ log.warning(f"The {self.name} syncer was aborted or timed out!")
+ await message.edit(content=f':x: {mention}{self.name} sync aborted or timed out!')
return False
@abc.abstractmethod