@@ -1010,7 +1010,6 @@ async def trigger_auto_triggers(self, message, channel, *, cls=commands.Context)
1010
1010
if trigger :
1011
1011
invoker = trigger .lower ()
1012
1012
1013
- print ("looking for auto trigger" , trigger , self .auto_triggers [trigger ])
1014
1013
alias = self .auto_triggers [trigger ]
1015
1014
1016
1015
ctxs = []
@@ -1020,39 +1019,32 @@ async def trigger_auto_triggers(self, message, channel, *, cls=commands.Context)
1020
1019
if not aliases :
1021
1020
logger .warning ("Alias %s is invalid as called in autotrigger." , invoker )
1022
1021
1023
- print ("Aliases" , aliases )
1024
-
1025
1022
for alias in aliases :
1023
+ print ("Initial view" , invoked_prefix + alias )
1026
1024
view = StringView (invoked_prefix + alias )
1027
- invoked_with = view .get_word ().lower ()
1028
- invoked_with = invoked_with [1 :]
1029
- print ("Looking for" , invoked_with )
1025
+ invoked_with = view .get_word ().lower ()[1 :]
1030
1026
found_command = self .all_commands .get (invoked_with )
1031
1027
1032
1028
# Check for alias
1033
1029
if not found_command :
1034
- print ("INVOKED WITH" , invoked_with )
1035
- command_alias = self .aliases .get (invoked_with )[1 :- 1 ]
1036
- view = StringView (invoked_prefix + command_alias )
1037
- split_cmd = command_alias .split (" " )
1038
- found_command = self .all_commands .get (split_cmd [0 ])
1030
+ invoked_with = self .aliases .get (invoked_with )[1 :- 1 ] # Get command linked to alias
1031
+ view = StringView (invoked_prefix + invoked_with ) # Create StringView for new command
1032
+ invoked_with = view .get_word ().lower ()[1 :] # Parse the new command
1033
+ found_command = self .all_commands .get (invoked_with ) # Get the command function
1039
1034
1040
1035
ctx_ = cls (prefix = self .prefix , view = view , bot = self , message = message )
1041
1036
ctx_ .command = found_command
1037
+
1042
1038
ctx_ .invoked_with = invoked_with
1043
1039
ctx_ .thread = thread
1044
1040
discord .utils .find (view .skip_string , await self .get_prefix ())
1045
1041
1046
- print ("Command info:" , view , ctx_ , ctx_ .thread , ctx_ .invoked_with , ctx_ .command )
1047
1042
ctxs += [ctx_ ]
1048
1043
1049
1044
for ctx in ctxs :
1050
1045
if ctx .command :
1051
- print ("Found command" )
1052
1046
old_checks = copy .copy (ctx .command .checks )
1053
- print ("Old checks set" )
1054
1047
ctx .command .checks = [checks .has_permissions (PermissionLevel .INVALID )]
1055
- print ("Command checks added, invoking..." , ctx )
1056
1048
await self .invoke (ctx )
1057
1049
1058
1050
ctx .command .checks = old_checks
0 commit comments