From 4d288e871c2a0ee159d84683c640323d9a382114 Mon Sep 17 00:00:00 2001 From: tamservo Date: Sun, 1 Dec 2024 17:12:07 -0500 Subject: [PATCH] Changed permission filter for race commands because discord changed the name to remove the # portion of the id name. --- robottas.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/robottas.py b/robottas.py index d2bca25..b8f3d96 100755 --- a/robottas.py +++ b/robottas.py @@ -429,6 +429,8 @@ class Robottas(commands.Bot): async def process_message(self, message): try: if isinstance(message, collections.abc.Sequence): + logging.debug(message) + if message[0] == 'Heartbeat': return @@ -1125,19 +1127,22 @@ class Robottas(commands.Bot): @self.command() async def race(ctx): - if str(ctx.author) == "tamservo#0" or ctx.author.guild_permissions.administrator: + if ctx.author.id == 581960756271251457 or \ + ctx.author.guild_permissions.administrator: await ctx.send(":robot::peach: Ready to report for the race!") await self._race_report(ctx) @self.command() async def quali(ctx): - if str(ctx.author) == "tamservo#0" or ctx.author.guild_permissions.administrator: + if ctx.author.id == 581960756271251457 or \ + ctx.author.guild_permissions.administrator: await ctx.send(":robot::peach: Ready to report on quali!") await self._quali_report(ctx) @self.command() async def practice(ctx): - if str(ctx.author) == "tamservo#0" or ctx.author.guild_permissions.administrator: + if ctx.author.id == 581960756271251457 or \ + ctx.author.guild_permissions.administrator: await ctx.send(":robot::peach: Ready to report on practice!") await self._practice_report(ctx) @@ -1156,7 +1161,9 @@ class Robottas(commands.Bot): @self.command() async def start_collect(ctx): - if str(ctx.author) == "tamservo#0" or ctx.author.guild_permissions.administrator: + # Check id for tamservo or admin on channel + if ctx.author.id == 581960756271251457 or \ + ctx.author.guild_permissions.administrator: # if an authorized user, start the collection script that # puts records into the database await self.start_collect()