mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 01:42:30 -05:00
[Alias] Aliased commands retain newlines (#4656)
Co-authored-by: Michael Oliveira <34169552+Flame442@users.noreply.github.com>
This commit is contained in:
@@ -150,6 +150,15 @@ class Alias(commands.Cog):
|
||||
raise ValueError("No prefix found.")
|
||||
|
||||
async def call_alias(self, message: discord.Message, prefix: str, alias: AliasEntry):
|
||||
new_message = self.translate_alias_message(message, prefix, alias)
|
||||
await self.bot.process_commands(new_message)
|
||||
|
||||
def translate_alias_message(self, message: discord.Message, prefix: str, alias: AliasEntry):
|
||||
"""
|
||||
Translates a discord message using an alias
|
||||
for a command to a discord message using the
|
||||
alias' base command.
|
||||
"""
|
||||
new_message = copy(message)
|
||||
try:
|
||||
args = alias.get_extra_args_from_alias(message, prefix)
|
||||
@@ -163,7 +172,8 @@ class Alias(commands.Cog):
|
||||
new_message.content = "{}{} {}".format(
|
||||
prefix, command, " ".join(args[trackform.max + 1 :])
|
||||
).strip()
|
||||
await self.bot.process_commands(new_message)
|
||||
|
||||
return new_message
|
||||
|
||||
async def paginate_alias_list(
|
||||
self, ctx: commands.Context, alias_list: List[AliasEntry]
|
||||
|
||||
Reference in New Issue
Block a user