From 226148fbb2d8816c5cf5aaa265e59bb4af1c410e Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Fri, 5 Jun 2026 12:53:00 -0700 Subject: [PATCH] This changes the default speed record to -1 and hides it from view --- techsupport_bot/commands/duck.py | 13 +++++++++---- techsupport_bot/core/databases.py | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/techsupport_bot/commands/duck.py b/techsupport_bot/commands/duck.py index 6c41724b1..d59660068 100644 --- a/techsupport_bot/commands/duck.py +++ b/techsupport_bot/commands/duck.py @@ -281,7 +281,7 @@ async def handle_winner( guild_id=str(guild.id), befriend_count=0, kill_count=0, - speed_record=80.0, + speed_record=-1.0, ) await duck_user.create() @@ -308,7 +308,7 @@ async def handle_winner( ) global_record = await self.get_global_record(guild.id) footer_string = "" - if duration_exact < duck_user.speed_record: + if duration_exact < duck_user.speed_record or duck_user.speed_record == -1: footer_string += f"New personal record: {duration_exact} seconds." if duration_exact < global_record: footer_string += "\nNew global record!" @@ -461,7 +461,9 @@ async def get_global_record(self: Self, guild_id: int) -> float: self.bot.models.DuckUser.guild_id == str(guild_id) ).gino.all() - speed_records = [record.speed_record for record in query] + speed_records = [ + record.speed_record for record in query if record.speed_record > 0 + ] if not speed_records: return None @@ -519,7 +521,10 @@ async def stats( embed.color = embed_colors.green() embed.add_field(name="Friends", value=duck_user.befriend_count) embed.add_field(name="Kills", value=duck_user.kill_count) - footer_string = f"Speed record: {str(duck_user.speed_record)} seconds" + if duck_user.speed_record > 0: + footer_string = f"Speed record: {str(duck_user.speed_record)} seconds" + else: + footer_string = "" if duck_user.speed_record == await self.get_global_record(ctx.guild.id): footer_string += "\nYou hold the current global record!" embed.set_footer(text=footer_string) diff --git a/techsupport_bot/core/databases.py b/techsupport_bot/core/databases.py index f3a9281fb..c58c08050 100644 --- a/techsupport_bot/core/databases.py +++ b/techsupport_bot/core/databases.py @@ -110,7 +110,7 @@ class DuckUser(bot.db.Model): updated: datetime.datetime = bot.db.Column( bot.db.DateTime, default=datetime.datetime.utcnow ) - speed_record: float = bot.db.Column(bot.db.Float, default=80.0) + speed_record: float = bot.db.Column(bot.db.Float, default=-1.0) class Factoid(bot.db.Model): """The postgres table for factoids