aboutsummaryrefslogtreecommitdiffstats
path: root/bot/converters.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/converters.py')
-rw-r--r--bot/converters.py36
1 files changed, 1 insertions, 35 deletions
diff --git a/bot/converters.py b/bot/converters.py
index 34a764567..c04158d4d 100644
--- a/bot/converters.py
+++ b/bot/converters.py
@@ -10,7 +10,7 @@ import discord
from aiohttp import ClientConnectorError
from dateutil.relativedelta import relativedelta
from discord.ext.commands import BadArgument, Context, Converter, IDConverter, MemberConverter, UserConverter
-from discord.utils import escape_markdown, snowflake_time
+from discord.utils import snowflake_time
from pydis_core.site_api import ResponseCodeError
from pydis_core.utils import unqualify
from pydis_core.utils.regex import DISCORD_INVITE
@@ -19,7 +19,6 @@ from bot import exts, instance as bot_instance
from bot.constants import URLs
from bot.errors import InvalidInfractionError
from bot.exts.info.doc import _inventory_parser
-from bot.exts.info.tags import TagIdentifier
from bot.log import get_logger
from bot.utils import time
@@ -220,39 +219,6 @@ class Snowflake(IDConverter):
return snowflake
-class SourceConverter(Converter):
- """Convert an argument into a help command, tag, command, or cog."""
-
- @staticmethod
- async def convert(ctx: Context, argument: str) -> SourceType:
- """Convert argument into source object."""
- if argument.lower() == "help":
- return ctx.bot.help_command
-
- cog = ctx.bot.get_cog(argument)
- if cog:
- return cog
-
- cmd = ctx.bot.get_command(argument)
- if cmd:
- return cmd
-
- tags_cog = ctx.bot.get_cog("Tags")
- show_tag = True
-
- if not tags_cog:
- show_tag = False
- else:
- identifier = TagIdentifier.from_string(argument.lower())
- if identifier in tags_cog.tags:
- return identifier
- escaped_arg = escape_markdown(argument)
-
- raise BadArgument(
- f"Unable to convert '{escaped_arg}' to valid command{', tag,' if show_tag else ''} or Cog."
- )
-
-
class DurationDelta(Converter):
"""Convert duration strings into dateutil.relativedelta.relativedelta objects."""