def no_auth(cls, informer, command_name, user_ID=None): commands.inform( informer, admin.whisper_text( "You are not authorised to use the " "command, %s." % command_name, informer in messages.coloured_informers), user_ID)
def disabled(cls, informer, command_name): commands.inform( informer, admin.whisper_text( "Command, %s, is currently " "disabled." % command_name, informer in messages.coloured_informers))
def _callback(self, args, informer=None, user_ID=None): if not self.menu_interface: self.callback(args, informer=informer, user_ID=user_ID, by_menu=False) return defaults = [ parameter.default_value if parameter.default_value is not commands.ABSENT else None for parameter in self.callback.parameters ] for index, value in enumerate(args[:]): if value == defaults[index]: args.remove(value) self.parameters[len(args)].menu.send(user_ID) args.insert(0, self.basename) menus.Menu.players[user_ID].identifiers.extend(args) if informer == commands.ClientConsoleCommand.INFORMER: commands.inform( informer, admin.whisper_text( "You have been sent a menu " "where you can select a value " "for the next parameter.", informer in messages.coloured_informers)) return
def no_auth(cls, informer, command_name, user_ID=None): commands.inform(informer, admin.whisper_text("You are not authorised to use the " "command, %s." % command_name, informer in messages.coloured_informers), user_ID)
def invalid_value(cls, informer, command_name, parameter, arg, user_ID=None): commands.inform(informer, admin.whisper_text("Invalid value, %s, for " "parameter, %s." %(arg, parameter.basename), informer in messages.coloured_informers), user_ID)
def invalid_value(cls, informer, command_name, parameter, arg, user_ID=None): commands.inform( informer, admin.whisper_text( "Invalid value, %s, for " "parameter, %s." % (arg, parameter.basename), informer in messages.coloured_informers), user_ID)
def _invalid_syntax_callback(self, informer, command_name, parameters, args, user_ID=None): total_args = len(args) if not self.menu_interface or total_args > len(parameters): commands.inform(informer, admin.whisper_text("Invalid syntax for command, " "%s." % command_name, informer in messages.coloured_informers), user_ID) else: self.parameters[total_args].menu.send(user_ID) args.insert(0, self.basename) menus.Menu.players[user_ID].identifiers.extend(args)
def _invalid_syntax_callback(self, informer, command_name, parameters, args, user_ID=None): total_args = len(args) if not self.menu_interface or total_args > len(parameters): commands.inform( informer, admin.whisper_text( "Invalid syntax for command, " "%s." % command_name, informer in messages.coloured_informers), user_ID) else: self.parameters[total_args].menu.send(user_ID) args.insert(0, self.basename) menus.Menu.players[user_ID].identifiers.extend(args)
def _callback(self, args, informer=None, user_ID=None): if not self.menu_interface: self.callback(args, informer=informer, user_ID=user_ID, by_menu=False) return defaults = [parameter.default_value if parameter.default_value is not commands.ABSENT else None for parameter in self.callback.parameters] for index, value in enumerate(args[:]): if value == defaults[index]: args.remove(value) self.parameters[len(args)].menu.send(user_ID) args.insert(0, self.basename) menus.Menu.players[user_ID].identifiers.extend(args) if informer == commands.ClientConsoleCommand.INFORMER: commands.inform(informer, admin.whisper_text("You have been sent a menu " "where you can select a value " "for the next parameter.", informer in messages.coloured_informers)) return
def disabled(cls, informer, command_name): commands.inform(informer, admin.whisper_text("Command, %s, is currently " "disabled." % command_name, informer in messages.coloured_informers))