From 8d3e61cab559909ce203e63f37412c2cffcf1474 Mon Sep 17 00:00:00 2001 From: Gideon McKinlay Date: Thu, 25 Jul 2024 15:39:53 +1000 Subject: [PATCH] Add fun messages on race conclusion --- uqcsbot/utils/snailrace_utils.py | 64 ++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/uqcsbot/utils/snailrace_utils.py b/uqcsbot/utils/snailrace_utils.py index 50276d2..311de2c 100644 --- a/uqcsbot/utils/snailrace_utils.py +++ b/uqcsbot/utils/snailrace_utils.py @@ -1,4 +1,7 @@ -import discord, random, datetime, asyncio +import discord +import random +import datetime +import asyncio # Racer Icon SNAILRACE_SNAIL_EMOJI = "🐌" @@ -35,6 +38,45 @@ SNAILRACE_WINNER = "The race has finished! %s has won!" SNAILRACE_WINNER_TIE = "The race has finished! It's a tie between %s!" +SNAILRACE_WIN_MESSAGES = [ + "πŸŽ‰πŸŽ‰", + "πŸŽ‰πŸŽ‰πŸŽ‰", + "🍾πŸ₯‚", + "πŸ₯³πŸ₯³", + "πŸ₯³πŸ₯³πŸ₯³", + "πŸ₯³πŸŽ‰", + "πŸ₯³πŸŽ‰πŸŽ‰", + "Congrats! πŸ₯³", + "Congratulations!", + "ggs!", + "For every winner, there is a loser.", +] +SNAILRACE_TIE_MESSAGES = [ + "MILLION TO ONE!", + "Everyone's a winner!", + "Nobody wins!", + "Friendship wins!", + "Time for a rematch?", + "That was just a warm-up!", +] +SNAILRACE_NO_CONTEST_MESSAGES = [ + "But it was against themselves, that was a little sad.", + "Suspicious there was no other snails though.", + "But wait, it was a false start.", + "At losing!", + "And also lost!", + "Wait was that it?", + "But wait, they used illegal snail doping.", + "But wait, the ref says they're disqualified.", + "You call that a race?", + "I think we could all see that happening.", + "Who could've guessed.", + "Uhh congrats?", + "Well done, I guess...", + "Wait no they didn't.", + "But wait, that was just a warm-up.", +] + SnailRaceJoinType = 0 | 1 | 2 SnailRaceJoinAdded = 0 SnailRaceJoinAlreadyJoined = 1 @@ -162,9 +204,23 @@ async def _start_racing(self, interaction: discord.Interaction): ) # Conclude the race and send the winner - if len(winners) == 1: - await interaction.channel.send(SNAILRACE_WINNER % winners[0]) + if len(self.racers) == 1: + await interaction.channel.send( + SNAILRACE_WINNER % winners[0] + + " " + + random.choice(SNAILRACE_NO_CONTEST_MESSAGES) + ) + elif len(winners) == 1: + await interaction.channel.send( + SNAILRACE_WINNER % winners[0] + + " " + + random.choice(SNAILRACE_WIN_MESSAGES) + ) else: - await interaction.channel.send(SNAILRACE_WINNER_TIE % ", ".join(winners)) + await interaction.channel.send( + SNAILRACE_WINNER_TIE % ", ".join(winners) + + " " + + random.choice(SNAILRACE_TIE_MESSAGES) + ) self.close_race()