@@ -1010,7 +1010,6 @@ async def trigger_auto_triggers(self, message, channel, *, cls=commands.Context)
10101010 if trigger :
10111011 invoker = trigger .lower ()
10121012
1013- print ("looking for auto trigger" , trigger , self .auto_triggers [trigger ])
10141013 alias = self .auto_triggers [trigger ]
10151014
10161015 ctxs = []
@@ -1020,39 +1019,32 @@ async def trigger_auto_triggers(self, message, channel, *, cls=commands.Context)
10201019 if not aliases :
10211020 logger .warning ("Alias %s is invalid as called in autotrigger." , invoker )
10221021
1023- print ("Aliases" , aliases )
1024-
10251022 for alias in aliases :
1023+ print ("Initial view" , invoked_prefix + alias )
10261024 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 :]
10301026 found_command = self .all_commands .get (invoked_with )
10311027
10321028 # Check for alias
10331029 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
10391034
10401035 ctx_ = cls (prefix = self .prefix , view = view , bot = self , message = message )
10411036 ctx_ .command = found_command
1037+
10421038 ctx_ .invoked_with = invoked_with
10431039 ctx_ .thread = thread
10441040 discord .utils .find (view .skip_string , await self .get_prefix ())
10451041
1046- print ("Command info:" , view , ctx_ , ctx_ .thread , ctx_ .invoked_with , ctx_ .command )
10471042 ctxs += [ctx_ ]
10481043
10491044 for ctx in ctxs :
10501045 if ctx .command :
1051- print ("Found command" )
10521046 old_checks = copy .copy (ctx .command .checks )
1053- print ("Old checks set" )
10541047 ctx .command .checks = [checks .has_permissions (PermissionLevel .INVALID )]
1055- print ("Command checks added, invoking..." , ctx )
10561048 await self .invoke (ctx )
10571049
10581050 ctx .command .checks = old_checks
0 commit comments