mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
Make the checks in [p]alias global add and [p]alias add consistent (#3797)
This commit is contained in:
parent
4757c2c945
commit
45afaa8ec8
@ -157,7 +157,7 @@ class Alias(commands.Cog):
|
|||||||
_(
|
_(
|
||||||
"You attempted to create a new alias"
|
"You attempted to create a new alias"
|
||||||
" with the name {name} but that"
|
" with the name {name} but that"
|
||||||
" alias already exists on this server."
|
" alias already exists."
|
||||||
).format(name=alias_name)
|
).format(name=alias_name)
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
@ -210,13 +210,13 @@ class Alias(commands.Cog):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
alias = await self._aliases.get_alias(ctx.guild, alias_name)
|
alias = await self._aliases.get_alias(None, alias_name)
|
||||||
if alias:
|
if alias:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
_(
|
_(
|
||||||
"You attempted to create a new global alias"
|
"You attempted to create a new global alias"
|
||||||
" with the name {name} but that"
|
" with the name {name} but that"
|
||||||
" alias already exists on this server."
|
" alias already exists."
|
||||||
).format(name=alias_name)
|
).format(name=alias_name)
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
@ -232,6 +232,13 @@ class Alias(commands.Cog):
|
|||||||
).format(name=alias_name)
|
).format(name=alias_name)
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
given_command_exists = self.bot.get_command(command.split(maxsplit=1)[0]) is not None
|
||||||
|
if not given_command_exists:
|
||||||
|
await ctx.send(
|
||||||
|
_("You attempted to create a new alias for a command that doesn't exist.")
|
||||||
|
)
|
||||||
|
return
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user