@@ -1016,42 +1016,43 @@ async def alias_add(self, ctx, name: str.lower, *, value):
10161016
10171017 multiple_alias = len (values ) > 1
10181018
1019- embed = discord .Embed (
1020- title = "Added alias" ,
1021- color = self .bot .main_color
1022- )
1019+ embed = discord .Embed (title = "Added alias" , color = self .bot .main_color )
10231020
1024- if multiple_alias :
1021+ if not multiple_alias :
10251022 embed .description = f'`{ name } ` points to: "{ values [0 ]} ".'
10261023 else :
10271024 embed .description = f"`{ name } ` now points to the following steps:"
10281025
10291026 for i , val in enumerate (values , start = 1 ):
10301027 view = StringView (val )
1031- linked_command = view .get_word ()
1028+ linked_command = view .get_word (). lower ()
10321029 message = view .read_rest ()
10331030
10341031 if not self .bot .get_command (linked_command ):
10351032 alias_command = self .bot .aliases .get (linked_command )
10361033 if alias_command is not None :
1037- save_aliases .append ( f" { alias_command } { message } " . strip ( ))
1034+ save_aliases .extend ( utils . normalize_alias ( alias_command , message ))
10381035 else :
10391036 embed = discord .Embed (title = "Error" , color = self .bot .error_color )
10401037
10411038 if multiple_alias :
1042- embed .description = ("The command you are attempting to point "
1043- f"to does not exist: `{ linked_command } `." )
1039+ embed .description = (
1040+ "The command you are attempting to point "
1041+ f"to does not exist: `{ linked_command } `."
1042+ )
10441043 else :
1045- embed .description = ("The command you are attempting to point "
1046- f"to n step { i } does not exist: `{ linked_command } `." )
1044+ embed .description = (
1045+ "The command you are attempting to point "
1046+ f"to n step { i } does not exist: `{ linked_command } `."
1047+ )
10471048
10481049 return await ctx .send (embed = embed )
10491050 else :
10501051 save_aliases .append (val )
10511052
10521053 embed .description += f"\n { i } : { val } "
10531054
1054- self .bot .aliases [name ] = " && " .join (f" \" { a } \" " for a in save_aliases )
1055+ self .bot .aliases [name ] = " && " .join (f'" { a } "' for a in save_aliases )
10551056 await self .bot .config .update ()
10561057 return await ctx .send (embed = embed )
10571058
@@ -1098,42 +1099,43 @@ async def alias_edit(self, ctx, name: str.lower, *, value):
10981099
10991100 multiple_alias = len (values ) > 1
11001101
1101- embed = discord .Embed (
1102- title = "Edited alias" ,
1103- color = self .bot .main_color
1104- )
1102+ embed = discord .Embed (title = "Edited alias" , color = self .bot .main_color )
11051103
1106- if multiple_alias :
1104+ if not multiple_alias :
11071105 embed .description = f'`{ name } ` points to: "{ values [0 ]} ".'
11081106 else :
11091107 embed .description = f"`{ name } ` now points to the following steps:"
11101108
11111109 for i , val in enumerate (values , start = 1 ):
11121110 view = StringView (val )
1113- linked_command = view .get_word ()
1111+ linked_command = view .get_word (). lower ()
11141112 message = view .read_rest ()
11151113
11161114 if not self .bot .get_command (linked_command ):
11171115 alias_command = self .bot .aliases .get (linked_command )
11181116 if alias_command is not None :
1119- save_aliases .append ( f" { alias_command } { message } " . strip ( ))
1117+ save_aliases .extend ( utils . normalize_alias ( alias_command , message ))
11201118 else :
11211119 embed = discord .Embed (title = "Error" , color = self .bot .error_color )
11221120
11231121 if multiple_alias :
1124- embed .description = ("The command you are attempting to point "
1125- f"to does not exist: `{ linked_command } `." )
1122+ embed .description = (
1123+ "The command you are attempting to point "
1124+ f"to does not exist: `{ linked_command } `."
1125+ )
11261126 else :
1127- embed .description = ("The command you are attempting to point "
1128- f"to n step { i } does not exist: `{ linked_command } `." )
1127+ embed .description = (
1128+ "The command you are attempting to point "
1129+ f"to n step { i } does not exist: `{ linked_command } `."
1130+ )
11291131
11301132 return await ctx .send (embed = embed )
11311133 else :
11321134 save_aliases .append (val )
11331135
11341136 embed .description += f"\n { i } : { val } "
11351137
1136- self .bot .aliases [name ] = " && " .join (f" \" { a } \" " for a in save_aliases )
1138+ self .bot .aliases [name ] = " && " .join (f'" { a } "' for a in save_aliases )
11371139 await self .bot .config .update ()
11381140 return await ctx .send (embed = embed )
11391141
0 commit comments