Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for command_trigger, command in self.command_list.copy().items():
- # Pre-check that command is indeed a Command
- if isinstance(command, Command):
- # Only change reference of Strings
- if isinstance(command.reference, str):
- # Replace valid function name(str) with function reference
- if getattr(self, command.reference):
- self.command_list[command_trigger].reference = getattr(self, command.reference)
Add Comment
Please, Sign In to add comment