def execute(self, string, **kwargs): if kwargs: string = sub(r'server_var\(([a-zA-Z0-9_]+)\)', r'{\1}', string).format(**kwargs) command = _Command(string) TypedServerCommand.on_command(command)
def server_sub_command(self, commands): """Add a server sub-command. .. seealso:: :class:`commands.typed.TypedServerCommand` """ if isinstance(commands, str): commands = [commands] command = TypedServerCommand([self._command] + list(commands)) self.append(command) return command