Skip to content

Commit

Permalink
Merge pull request #6 from CircuitSacul/master
Browse files Browse the repository at this point in the history
remove old send_cmd_help in favor of ctx.send_help
  • Loading branch information
OldBeafantles authored Apr 6, 2021
2 parents 07c1ca2 + 7fb6924 commit b280a4b
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions modules/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@
class Code(commands.Cog):
"""Code module"""

async def send_cmd_help(self, ctx, message: str = ""):
if ctx.invoked_subcommand:
pages = self.bot.formatter.format_help_for(ctx,
ctx.invoked_subcommand)
for page in pages:
await self.bot.send_message(ctx.message.channel,
message + "\n" + page)
else:
pages = await self.bot.formatter.format_help_for(ctx, ctx.command)
for page in pages:
await ctx.message.channel.send(message + "\n" + page)

def __init__(self, bot):
self.bot = bot
self.timeout = 15
Expand Down Expand Up @@ -763,10 +751,10 @@ def set_user_sub_config(self, user: discord.Member, sub_config_name: str,
utils.save_json(self.users_configuration, self.users_configuration_path)

@commands.group()
async def config(self, ctx):
async def config(self, ctx: commands.Context):
"""Configures your default settings"""
if ctx.invoked_subcommand is None:
await self.send_cmd_help(ctx)
await ctx.send_help(ctx.command)

@config.command()
async def output(self, ctx, output_mode: str = ""):
Expand Down

0 comments on commit b280a4b

Please sign in to comment.