diff options
Diffstat (limited to 'bot/exts/evergreen')
| -rw-r--r-- | bot/exts/evergreen/emoji.py | 4 | ||||
| -rw-r--r-- | bot/exts/evergreen/game.py | 4 | ||||
| -rw-r--r-- | bot/exts/evergreen/minesweeper.py | 4 | ||||
| -rw-r--r-- | bot/exts/evergreen/movie.py | 4 | ||||
| -rw-r--r-- | bot/exts/evergreen/snakes/_snakes_cog.py | 4 | ||||
| -rw-r--r-- | bot/exts/evergreen/space.py | 4 | ||||
| -rw-r--r-- | bot/exts/evergreen/status_codes.py | 4 |
7 files changed, 14 insertions, 14 deletions
diff --git a/bot/exts/evergreen/emoji.py b/bot/exts/evergreen/emoji.py index 40bf83e8..042e539d 100644 --- a/bot/exts/evergreen/emoji.py +++ b/bot/exts/evergreen/emoji.py @@ -11,6 +11,7 @@ from discord.ext import commands from bot.constants import Colours, ERROR_REPLIES from bot.utils.pagination import LinePaginator from bot.utils.time import time_since +from bot.utils.extensions import invoke_help_command log = logging.getLogger(__name__) @@ -75,8 +76,7 @@ class Emojis(commands.Cog): if emoji is not None: await ctx.invoke(self.info_command, emoji) else: - help_command = self.bot.get_command("help") - await ctx.invoke(help_command, ctx.command.name) + await invoke_help_command(ctx, ctx.command.name) @emoji_group.command(name="count", aliases=("c",)) async def count_command(self, ctx: commands.Context, *, category_query: str = None) -> None: diff --git a/bot/exts/evergreen/game.py b/bot/exts/evergreen/game.py index d49a8858..ab4cae77 100644 --- a/bot/exts/evergreen/game.py +++ b/bot/exts/evergreen/game.py @@ -16,6 +16,7 @@ from bot.bot import Bot from bot.constants import STAFF_ROLES, Tokens from bot.utils.decorators import with_role from bot.utils.pagination import ImagePaginator, LinePaginator +from bot.utils.extensions import invoke_help_command # Base URL of IGDB API BASE_URL = "https://api.igdb.com/v4" @@ -234,8 +235,7 @@ class Games(Cog): """ # When user didn't specified genre, send help message if genre is None: - help_command = self.bot.get_command("help") - await ctx.invoke(help_command, ctx.command.name) + await invoke_help_command(ctx, ctx.command.name) return # Capitalize genre for check diff --git a/bot/exts/evergreen/minesweeper.py b/bot/exts/evergreen/minesweeper.py index 06a75c2b..cfe7150e 100644 --- a/bot/exts/evergreen/minesweeper.py +++ b/bot/exts/evergreen/minesweeper.py @@ -8,6 +8,7 @@ from discord.ext import commands from bot.constants import Client from bot.utils.exceptions import UserNotPlayingError +from bot.utils.extensions import invoke_help_command MESSAGE_MAPPING = { 0: ":stop_button:", @@ -83,8 +84,7 @@ class Minesweeper(commands.Cog): @commands.group(name='minesweeper', aliases=('ms',), invoke_without_command=True) async def minesweeper_group(self, ctx: commands.Context) -> None: """Commands for Playing Minesweeper.""" - help_command = ctx.bot.get_command("help") - await ctx.invoke(help_command, ctx.command.name) + await invoke_help_command(ctx, ctx.command.name) @staticmethod def get_neighbours(x: int, y: int) -> typing.Generator[typing.Tuple[int, int], None, None]: diff --git a/bot/exts/evergreen/movie.py b/bot/exts/evergreen/movie.py index 238ab038..9aa3aea7 100644 --- a/bot/exts/evergreen/movie.py +++ b/bot/exts/evergreen/movie.py @@ -10,6 +10,7 @@ from discord.ext.commands import Bot, Cog, Context, group from bot.constants import Tokens from bot.utils.pagination import ImagePaginator +from bot.utils.extensions import invoke_help_command # Define base URL of TMDB BASE_URL = "https://api.themoviedb.org/3/" @@ -73,8 +74,7 @@ class Movie(Cog): try: result = await self.get_movies_list(self.http_session, MovieGenres[genre].value, 1) except KeyError: - help_command = self.bot.get_command("help") - await ctx.invoke(help_command, ctx.command.name) + await invoke_help_command(ctx, ctx.command.name) return # Check if "results" is in result. If not, throw error. diff --git a/bot/exts/evergreen/snakes/_snakes_cog.py b/bot/exts/evergreen/snakes/_snakes_cog.py index 819a98b2..d0e60819 100644 --- a/bot/exts/evergreen/snakes/_snakes_cog.py +++ b/bot/exts/evergreen/snakes/_snakes_cog.py @@ -22,6 +22,7 @@ from bot.constants import ERROR_REPLIES, Tokens from bot.exts.evergreen.snakes import _utils as utils from bot.exts.evergreen.snakes._converter import Snake from bot.utils.decorators import locked +from bot.utils.extensions import invoke_help_command log = logging.getLogger(__name__) @@ -440,8 +441,7 @@ class Snakes(Cog): @group(name='snakes', aliases=('snake',), invoke_without_command=True) async def snakes_group(self, ctx: Context) -> None: """Commands from our first code jam.""" - help_command = self.bot.get_command("help") - await ctx.invoke(help_command, ctx.command.name) + await invoke_help_command(ctx, ctx.command.name) @bot_has_permissions(manage_messages=True) @snakes_group.command(name='antidote') diff --git a/bot/exts/evergreen/space.py b/bot/exts/evergreen/space.py index e388e13f..305d6721 100644 --- a/bot/exts/evergreen/space.py +++ b/bot/exts/evergreen/space.py @@ -10,6 +10,7 @@ from discord.ext.commands import BadArgument, Cog, Context, Converter, group from bot.bot import Bot from bot.constants import Tokens +from bot.utils.extensions import invoke_help_command logger = logging.getLogger(__name__) @@ -63,8 +64,7 @@ class Space(Cog): @group(name="space", invoke_without_command=True) async def space(self, ctx: Context) -> None: """Head command that contains commands about space.""" - help_command = self.bot.get_command("help") - await ctx.invoke(help_command, ctx.command.name) + await invoke_help_command(ctx, ctx.command.name) @space.command(name="apod") async def apod(self, ctx: Context, date: Optional[str] = None) -> None: diff --git a/bot/exts/evergreen/status_codes.py b/bot/exts/evergreen/status_codes.py index d06724eb..a037e117 100644 --- a/bot/exts/evergreen/status_codes.py +++ b/bot/exts/evergreen/status_codes.py @@ -2,6 +2,7 @@ from http import HTTPStatus import discord from discord.ext import commands +from bot.utils.extensions import invoke_help_command HTTP_DOG_URL = "https://httpstatusdogs.com/img/{code}.jpg" HTTP_CAT_URL = "https://http.cat/{code}.jpg" @@ -17,8 +18,7 @@ class HTTPStatusCodes(commands.Cog): async def http_status_group(self, ctx: commands.Context) -> None: """Group containing dog and cat http status code commands.""" if not ctx.invoked_subcommand: - help_command = self.bot.get_command("help") - await ctx.invoke(help_command, ctx.command.name) + await invoke_help_command(ctx, ctx.command.name) @http_status_group.command(name='cat') async def http_cat(self, ctx: commands.Context, code: int) -> None: |