import discord from discord.ext.commands.converter import MessageConverter class WrappedMessageConverter(MessageConverter): """A converter that handles embed-suppressed links like .""" async def convert(self, ctx: discord.ext.commands.Context, argument: str) -> discord.Message: """Wrap the commands.MessageConverter to handle <> delimited message links.""" # It's possible to wrap a message in [<>] as well, and it's supported because its easy if argument.startswith("[") and argument.endswith("]"): argument = argument[1:-1] if argument.startswith("<") and argument.endswith(">"): argument = argument[1:-1] return await super().convert(ctx, argument)