commands

async clean_text_or_reply(ctx, text=None)[source]

Cleans a text argument or replied message’s content.

Parameters:
  • ctx (Context) – The command’s context

  • text (Optional[str]) – The provided text argument of the command (if given)

Raises:

discord.ext.commands.BadArgumenttext wasn’t provided and there’s no reply message / reply message content.

Return type:

str

Returns:

The cleaned version of text, if given, else replied message.