From 36eb384f10d2c147b8f8f884944c1dc66c4e046e Mon Sep 17 00:00:00 2001 From: "William C." Date: Thu, 7 Mar 2024 00:08:17 -0500 Subject: [PATCH] this one goes out to the one fork (thanks md) --- cogs/economy.py | 4 +-- main.py | 67 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 65 insertions(+), 6 deletions(-) diff --git a/cogs/economy.py b/cogs/economy.py index 5892856..20fecc2 100644 --- a/cogs/economy.py +++ b/cogs/economy.py @@ -463,7 +463,7 @@ async def deposit(ctx, amount): embed = voltage.SendableEmbed( title=ctx.author.display_name, icon_url=ctx.author.display_avatar.url, - description=f"You deposited **all** your money into your bank account! {sep}You have `${(await userdb.find_one({'userid': ctx.author.id}))['economy']['bank']:,}` in your bank account!", + description=f"You deposited **all** your money into your bank account! {sep}You have `${(await userdb.find_one({'userid': ctx.author.id}))['economy']['wallet']:,}` in your wallet!", color="#00FF00", ) await ctx.reply(embed=embed) @@ -499,7 +499,7 @@ async def deposit(ctx, amount): @eco.command(name="coinflip", aliases=['cf', 'coin', 'flip'], description="Flip a coin!") @limiter(7, on_ratelimited=lambda ctx, delay, *_1, **_2: ctx.send(f"You're on cooldown! Please wait `{round(delay, 2)}s`!")) - async def coinflip(ctx, user:voltage.User=None, bet:int=None, choice:str=None): + async def coinflip(ctx, bet:int=None, choice:str=None, user:voltage.User=None): if not bet or bet < 0: return await ctx.reply("Please enter a valid bet!") else: diff --git a/main.py b/main.py index be94fa7..a166f94 100644 --- a/main.py +++ b/main.py @@ -73,10 +73,7 @@ async def send_help(self, ctx: commands.CommandContext): colour="#516BF2", icon_url=ctx.author.display_avatar.url ) - text = f"{sep}### **No Category**{sep}" - for command in self.client.commands.values(): - if command.cog is None: - text += f"> {command.name}{sep}" + text = "" for i in self.client.cogs.values(): text += f"{sep}### **{i.name}**{sep}{i.description}{sep}" for j in i.commands: @@ -85,6 +82,68 @@ async def send_help(self, ctx: commands.CommandContext): embed.description += text return await ctx.reply(embed=embed) +# will continue this later +class Help(commands.HelpCommand): + async def send_help(self, ctx: commands.CommandContext): + embed = voltage.SendableEmbed( + title="Help", + description=f"Use `{ctx.prefix}help ` to get help for a command.", + colour="#fff0f0", + icon_url=client.user.display_avatar.url, + ) + text = "\n### **No Category**\n" + covered = [] + for command in self.client.commands.values(): + if command in covered: + continue + if command.cog is None: + text += f"> {command.name}\n" + covered.append(command) + for i in self.client.cogs.values(): + text += f"\n### **{i.name}**\n{i.description}\n" + for j in i.commands: + text += f"\n> {j.name}" + covered.append(j) + if embed.description: + embed.description += text + return await ctx.reply(embed=embed) + + async def send_command_help(self, ctx: commands.CommandContext, command: commands.Command): + embed = voltage.SendableEmbed( + title=f"Help for {command.name}", + colour="#0000ff", + icon_url=client.user.display_avatar.url, + ) + text = str() + text += f"\n### **Usage**\n> `{ctx.prefix}{command.usage}`" + if command.aliases: + text += f"\n\n### **Aliases**\n> {ctx.prefix}{', '.join(command.aliases)}" + embed.description = command.description + text if command.description else text + return await ctx.reply(embed=embed) + + async def send_cog_help(self, ctx: commands.CommandContext, cog: commands.Cog): + embed = voltage.SendableEmbed( + title=f"Help for {cog.name}", + colour="#0000ff", + icon_url=client.user.display_avatar.url, + ) + text = str() + text += f"\n### **Description**\n{cog.description}" + text += f"\n\n### **Commands**\n" + for command in cog.commands: + text += f"> {ctx.prefix}{command.name}\n" + embed.description = text + return await ctx.reply(embed=embed) + + async def send_not_found(self, ctx: commands.CommandContext, target: str): + embed = voltage.SendableEmbed( + title="Help", + description=f"`{ctx.prefix}{target} doesnt exist!`", + colour="#fff0f0", + icon_url=client.user.display_avatar.url + ) + return await ctx.send(embed=embed) + async def serverupdate(): for server in client.servers: i = 0