Skip to content

Commit

Permalink
this one goes out to the one fork (thanks md)
Browse files Browse the repository at this point in the history
  • Loading branch information
2vw committed Mar 7, 2024
1 parent c2ebb14 commit 36eb384
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cogs/economy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
67 changes: 63 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 <command>` 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
Expand Down

0 comments on commit 36eb384

Please sign in to comment.