@@ -1055,10 +1055,14 @@ async def alias_add(self, ctx, name: str.lower, *, value):
1055
1055
return await ctx .send (embed = embed )
1056
1056
1057
1057
if len (values ) == 1 :
1058
- linked_command = values [0 ].split ()[ 0 ]. lower ( )
1058
+ linked_command , * messages = values [0 ].split (maxsplit = 1 )
1059
1059
if not self .bot .get_command (linked_command ):
1060
- if linked_command in self .bot .aliases :
1061
- values = [self .bot .aliases .get (linked_command )]
1060
+ alias_command = self .bot .aliases .get (linked_command )
1061
+ if alias_command is not None :
1062
+ if messages :
1063
+ values = [f"{ alias_command } { messages [0 ]} " ]
1064
+ else :
1065
+ values = [alias_command ]
1062
1066
else :
1063
1067
embed = discord .Embed (
1064
1068
title = "Error" ,
@@ -1082,17 +1086,20 @@ async def alias_add(self, ctx, name: str.lower, *, value):
1082
1086
)
1083
1087
1084
1088
for i , val in enumerate (values , start = 1 ):
1085
- linked_command = val .split ()[ 0 ]
1089
+ linked_command , * messages = val .split (maxsplit = 1 )
1086
1090
if not self .bot .get_command (linked_command ):
1087
- if linked_command in self .bot .aliases :
1088
- index = values .index (linked_command )
1089
- values [index ] = self .bot .aliases .get (linked_command )
1091
+ alias_command = self .bot .aliases .get (linked_command )
1092
+ if alias_command is not None :
1093
+ if messages :
1094
+ values = [f"{ alias_command } { messages [0 ]} " ]
1095
+ else :
1096
+ values = [alias_command ]
1090
1097
else :
1091
1098
embed = discord .Embed (
1092
1099
title = "Error" ,
1093
1100
color = self .bot .error_color ,
1094
1101
description = "The command you are attempting to point "
1095
- f"to on step { i } does not exist: `{ linked_command } `." ,
1102
+ f"to n step { i } does not exist: `{ linked_command } `." ,
1096
1103
)
1097
1104
return await ctx .send (embed = embed )
1098
1105
embed .description += f"\n { i } : { val } "
@@ -1143,15 +1150,22 @@ async def alias_edit(self, ctx, name: str.lower, *, value):
1143
1150
return await ctx .send (embed = embed )
1144
1151
1145
1152
if len (values ) == 1 :
1146
- linked_command = values [0 ].split ()[ 0 ]. lower ( )
1153
+ linked_command , * messages = values [0 ].split (maxsplit = 1 )
1147
1154
if not self .bot .get_command (linked_command ):
1148
- embed = discord .Embed (
1149
- title = "Error" ,
1150
- color = self .bot .error_color ,
1151
- description = "The command you are attempting to point "
1152
- f"to does not exist: `{ linked_command } `." ,
1153
- )
1154
- return await ctx .send (embed = embed )
1155
+ alias_command = self .bot .aliases .get (linked_command )
1156
+ if alias_command is not None :
1157
+ if messages :
1158
+ values = [f"{ alias_command } { messages [0 ]} " ]
1159
+ else :
1160
+ values = [alias_command ]
1161
+ else :
1162
+ embed = discord .Embed (
1163
+ title = "Error" ,
1164
+ color = self .bot .error_color ,
1165
+ description = "The command you are attempting to point "
1166
+ f"to does not exist: `{ linked_command } `." ,
1167
+ )
1168
+ return await ctx .send (embed = embed )
1155
1169
embed = discord .Embed (
1156
1170
title = "Edited alias" ,
1157
1171
color = self .bot .main_color ,
@@ -1166,15 +1180,22 @@ async def alias_edit(self, ctx, name: str.lower, *, value):
1166
1180
)
1167
1181
1168
1182
for i , val in enumerate (values , start = 1 ):
1169
- linked_command = val .split ()[ 0 ]
1183
+ linked_command , * messages = val .split (maxsplit = 1 )
1170
1184
if not self .bot .get_command (linked_command ):
1171
- embed = discord .Embed (
1172
- title = "Error" ,
1173
- color = self .bot .error_color ,
1174
- description = "The command you are attempting to point "
1175
- f"to on step { i } does not exist: `{ linked_command } `." ,
1176
- )
1177
- return await ctx .send (embed = embed )
1185
+ alias_command = self .bot .aliases .get (linked_command )
1186
+ if alias_command is not None :
1187
+ if messages :
1188
+ values = [f"{ alias_command } { messages [0 ]} " ]
1189
+ else :
1190
+ values = [alias_command ]
1191
+ else :
1192
+ embed = discord .Embed (
1193
+ title = "Error" ,
1194
+ color = self .bot .error_color ,
1195
+ description = "The command you are attempting to point "
1196
+ f"to on step { i } does not exist: `{ linked_command } `." ,
1197
+ )
1198
+ return await ctx .send (embed = embed )
1178
1199
embed .description += f"\n { i } : { val } "
1179
1200
1180
1201
self .bot .aliases [name ] = "&&" .join (values )
0 commit comments