From 9ff9dde701d5ac0d07524692df7a39048ff63e93 Mon Sep 17 00:00:00 2001 From: TanguyPcFixe Date: Sat, 4 Jul 2026 21:39:47 +0200 Subject: [PATCH] added safety for carriers name (only allow those in the list in case someone has the funny idea of ignoring the autocomplete. No fingers pointed, of course. Light. --- cogs/IdaCogs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cogs/IdaCogs.py b/cogs/IdaCogs.py index 1441fb4..7fa2832 100644 --- a/cogs/IdaCogs.py +++ b/cogs/IdaCogs.py @@ -234,8 +234,15 @@ class IdaCogs(commands.Cog): async def setCarrierState(self, ctx, carrier, state): response = await helpers.getFromSheet(self.session, self.gsheetToken, "carrier") + await ctx.defer() + #transforms the response into a dict (carrier : state) we can use carrierState = await helpers.parseCarrierState(response) + + if carrier not in carrierState.keys(): + await ctx.followup.send(f"The specified carrier {carrier} is not in the allowed list! Quitting!") + return 0 + author = str(ctx.author) carrierState[carrier] = state @@ -244,7 +251,7 @@ class IdaCogs(commands.Cog): #print(rawState) - await ctx.defer() + i = 1 text = "Current Carrier State : \n"