Add error logging for failed transaction notifications

This commit is contained in:
Cal Corum 2025-01-18 07:24:51 -06:00
parent f8716c69cb
commit 81933e8329

View File

@ -429,12 +429,18 @@ class Transactions(commands.Cog):
cancel_text = f'Your transaction containing {trans_data[0]["name"]} has been cancelled because some douche ' \
f'with a worse team wanted him, too.'
gm_one = guild.get_member(team['gmid'])
try:
await gm_one.send(cancel_text)
except Exception as e:
logger.error(f'Could not notify GM1 of {team["abbrev"]} ({team["gmid"]}) of move cancellation: {e}')
gm_two = None
if team['gmid2'] is not None:
gm_two = guild.get_member(team['gmid2'])
try:
await gm_two.send(cancel_text)
except Exception as e:
logger.error(f'Could not notifiy GM2 of {team["abbrev"]} ({team["gmid2"]})of move cancellation: {e}')
async def process_freeze_moves(self, current):
# all_moves = await get_transactions(