@@ -1016,42 +1016,43 @@ async def alias_add(self, ctx, name: str.lower, *, value):
1016
1016
1017
1017
multiple_alias = len (values ) > 1
1018
1018
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 )
1023
1020
1024
- if multiple_alias :
1021
+ if not multiple_alias :
1025
1022
embed .description = f'`{ name } ` points to: "{ values [0 ]} ".'
1026
1023
else :
1027
1024
embed .description = f"`{ name } ` now points to the following steps:"
1028
1025
1029
1026
for i , val in enumerate (values , start = 1 ):
1030
1027
view = StringView (val )
1031
- linked_command = view .get_word ()
1028
+ linked_command = view .get_word (). lower ()
1032
1029
message = view .read_rest ()
1033
1030
1034
1031
if not self .bot .get_command (linked_command ):
1035
1032
alias_command = self .bot .aliases .get (linked_command )
1036
1033
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 ))
1038
1035
else :
1039
1036
embed = discord .Embed (title = "Error" , color = self .bot .error_color )
1040
1037
1041
1038
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
+ )
1044
1043
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
+ )
1047
1048
1048
1049
return await ctx .send (embed = embed )
1049
1050
else :
1050
1051
save_aliases .append (val )
1051
1052
1052
1053
embed .description += f"\n { i } : { val } "
1053
1054
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 )
1055
1056
await self .bot .config .update ()
1056
1057
return await ctx .send (embed = embed )
1057
1058
@@ -1098,42 +1099,43 @@ async def alias_edit(self, ctx, name: str.lower, *, value):
1098
1099
1099
1100
multiple_alias = len (values ) > 1
1100
1101
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 )
1105
1103
1106
- if multiple_alias :
1104
+ if not multiple_alias :
1107
1105
embed .description = f'`{ name } ` points to: "{ values [0 ]} ".'
1108
1106
else :
1109
1107
embed .description = f"`{ name } ` now points to the following steps:"
1110
1108
1111
1109
for i , val in enumerate (values , start = 1 ):
1112
1110
view = StringView (val )
1113
- linked_command = view .get_word ()
1111
+ linked_command = view .get_word (). lower ()
1114
1112
message = view .read_rest ()
1115
1113
1116
1114
if not self .bot .get_command (linked_command ):
1117
1115
alias_command = self .bot .aliases .get (linked_command )
1118
1116
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 ))
1120
1118
else :
1121
1119
embed = discord .Embed (title = "Error" , color = self .bot .error_color )
1122
1120
1123
1121
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
+ )
1126
1126
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
+ )
1129
1131
1130
1132
return await ctx .send (embed = embed )
1131
1133
else :
1132
1134
save_aliases .append (val )
1133
1135
1134
1136
embed .description += f"\n { i } : { val } "
1135
1137
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 )
1137
1139
await self .bot .config .update ()
1138
1140
return await ctx .send (embed = embed )
1139
1141
0 commit comments