def __register_help_messages(self):
     self.register_help_message(
         HelpMessage(
             self, self.control_command_prefix,
             self.plugin_manager.mcdr_server.tr(
                 'mcdr_command.help_message.mcdr_command'),
             PermissionLevel.MCDR_CONTROL_LEVEL))
     self.register_help_message(
         HelpMessage(
             self, self.help_command_prefix,
             self.plugin_manager.mcdr_server.tr(
                 'mcdr_command.help_message.help_command'),
             PermissionLevel.MINIMUM_LEVEL))
Beispiel #2
0
 def __register_help_messages(self):
     self.add_help_message(
         HelpMessage(
             self, '!!MCDR',
             self.plugin_manager.mcdr_server.tr(
                 'mcdr_command.help_message_mcdr'),
             PermissionLevel.MCDR_CONTROL_LEVEL))
Beispiel #3
0
    def register_help_message(
            self,
            prefix: str,
            message: Union[MessageText, TranslationKeyDictRich],
            permission: int = PermissionLevel.MINIMUM_LEVEL) -> None:
        """
		Register a help message for the current plugin, which is used in !!help command
		:param prefix: The help command of your plugin. When player click on the displayed message it will suggest this
		prefix parameter to the player. It's recommend to set it to the entry command of your plugin
		:param message: A neat command description. It can be a str or a RText. Also it can be a dict maps from language to description message
		:param permission: The minimum permission level for the user to see this help message. With default, anyone
		can see this message
		"""
        self.__plugin.register_help_message(
            HelpMessage(self.__plugin, prefix, message, permission))
Beispiel #4
0
    def add_help_message(self,
                         prefix,
                         message,
                         permission=PermissionLevel.MINIMUM_LEVEL):
        """
		Add a help message for the current plugin, which is used in !!help command

		:param str prefix: The help command of your plugin
		When player click on the displayed message it will suggest this prefix parameter to the player
		:param str or RTextBase message: A neat command description
		:param int permission: The minimum permission level for the user to see this help message. With default, anyone
		can see this message
		:raise: IllegalCallError if it's not called in a MCDR provided thread
		"""
        plugin = self.__get_current_plugin()
        if isinstance(message, str):
            message = RText(message)
        plugin.add_help_message(
            HelpMessage(plugin, prefix, message, permission))
    def register_help_message(
            self,
            prefix: str,
            message: Union[str, RTextBase],
            permission: int = PermissionLevel.MINIMUM_LEVEL) -> None:
        """
		Register a help message for the current plugin, which is used in !!help command
		:param prefix: The help command of your plugin. When player click on the displayed message it will suggest this
		prefix parameter to the player. It's recommend to set it to the entry command of your plugin
		:param message: A neat command description
		:param permission: The minimum permission level for the user to see this help message. With default, anyone
		can see this message
		:raise: IllegalCallError if it's not invoked in the task executor thread
		"""
        plugin = self.__get_current_plugin()
        if isinstance(message, str):
            message = RText(message)
        plugin.register_help_message(
            HelpMessage(plugin, prefix, message, permission))