From 0f05b7ea93e59a5b406abf746eeb2e6d67de1b68 Mon Sep 17 00:00:00 2001 From: Taledo's PC Date: Sun, 23 Aug 2026 05:26:12 +0200 Subject: [PATCH] added bulk command to bulk deliver. --- cogs/IdaCogs.py | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/cogs/IdaCogs.py b/cogs/IdaCogs.py index bbca1b7..89050e9 100644 --- a/cogs/IdaCogs.py +++ b/cogs/IdaCogs.py @@ -118,6 +118,67 @@ class IdaCogs(commands.Cog): channel = self.bot.get_channel(self.debugChannel) await channel.send(f"{author} generated the following exception : {traceback.format_exc()}") +## bulk delivery + + @option("commodity",required=True, + description = "The Commodity you want to deliver", + choices = [ + "Aluminium", + "Ceramic Composites", + "CMM Composite", + "Computer Components", + "Copper", + "Food Cartridges", + "Fruit and Vegetables", + "Insulating Membrane", + "Liquid Oxygen", + "Medical Diagnostic Equipment", + "Non-Lethal Weapons", + "Polymers", + "Power Generators", + "Semiconductors", + "Steel", + "Superconductors", + "Titanium", + "Water", + "Water Purifiers" + ]) + + @option("quantity",required=True, + description="Please be nice and input a value between 1 and 25000", + type=int, min_value=1, max_value=25000) + @option("target", required=True, + description="Are you delivering to a carrier or the target station?", + type=str, choices=['Station', 'Carrier']) + + async def bulk(self, ctx,commodity, quantity,target): + + author = str(ctx.author) + author = author[:author.find(" ")] + + await ctx.defer() + + data = { + "postType":"delivery", + "username":author, + "commodity": commodity, + "quantity": quantity, + "target": target + } + + try: + response = await helpers.postToSheet(self.session, data, self.gsheetToken) + if response == 200: + await ctx.followup.send(f"your delivery of {quantity} of {commodity} to a {target} has been added to the sheet!") + print(f"[{datetime.isoformat(datetime.now())}]{author} delivery of {quantity} of {commodity} to a {target}") + await helpers.writeDeliveryToCommandFile(author, data) + else: + await ctx.followup.send(f"Google returned an error. (HTTP {response}). But your delivery may have gone through. Maybe. Maybe not? who knows? Not fucking Google apparently. ") + + except Exception as e: + await ctx.followup.send(f"Something broke. Why do you keep breaking the bot, uh? :(") + channel = self.bot.get_channel(self.debugChannel) + await channel.send(f"{author} generated the following exception : {traceback.format_exc()}") # delivery command for misc commodity only