From 52801b4de1d63cd01191acf7fcee137977140ec0 Mon Sep 17 00:00:00 2001 From: lexicade Date: Fri, 27 Jan 2023 21:06:30 +0000 Subject: Project init --- cogs/cancelled_Requests.py | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 cogs/cancelled_Requests.py (limited to 'cogs/cancelled_Requests.py') diff --git a/cogs/cancelled_Requests.py b/cogs/cancelled_Requests.py new file mode 100644 index 0000000..53b6124 --- /dev/null +++ b/cogs/cancelled_Requests.py @@ -0,0 +1,62 @@ +from discord.ext import commands +import discord +import re +import importlib +import utils +importlib.reload(utils) + + +class Requests(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @commands.command() + async def dr(self, ctx, *args): + """WIP.""" + + request_data = {"dinosaurs": ["herrerasaurus", "austroraptor", "baryonyx", "albertosaurus", "acrocanthosaurus", "stegosaurus", "ankylosaurus", "therizinosaurus", "avaceratops", "velociraptor", "orodromeus", "psittacosaurus"], + "genders": ["m", "f"], + "safe_logged": ["y", "n"], + "steamid": ""} + + if len(args) != len(request_data): + await ctx.send(content=f"args:{len(args)}, data:{len(request_data)}") + return + + for i, field in enumerate(request_data): + print(f"data:{field} field:{request_data[field]} type:{type(request_data[field])}") + + if not any(args[i].casefold() == cur_arg for cur_arg in request_data[field]): + emb = await utils.embed(ctx, "Command failed", "Command should be structured as followed: `!dr [steamid] [dinosaur] [M/F] [Y/N]`") + emb = await utils.field(emb, "Dinosaurs", ", ".join(request_data[field])) + await ctx.send(content=f"Failed on {field}", embed=emb) + return + + await ctx.send(content="Yes") + + # if len(args) == arg_count: + # dinosaur = args[1] + # gender = args[2] + # safe_logged = args[3] + # steamid = args[0] + # + # dino_check = any(dinosaur.casefold() == dino for dino in lst_dino) + # print(f"Dino check: {dino_check}") + + + # else: + # emb = await utils.embed(ctx, "Command failed", "Command should be structured as followed: `!dr [steamid] [dinosaur] [M/F] [Y/N]`") + # emb = await utils.field(emb, "Dinosaurs", ", ".join(lst_dino)) + # await ctx.send() + # print("Improper args") + + # validate steamid + +def setup(bot): + print("INFO: Loading [Requests]... ", end="") + bot.add_cog(Requests(bot)) + print("Done!") + + +def teardown(bot): + print("INFO: Unloading [Requests]") -- cgit v1.2.3