Ejemplo n.º 1
0
def setup_user_settings():
    """Set up user settings."""
    _sp_logger.log_debug('Setting up user settings...')

    from commands.client import client_command_manager
    from commands.say import say_command_manager
    from settings.menu import _player_settings
    from core.settings import _core_settings

    # Are there any private user settings say commands?
    if _core_settings['USER_SETTINGS']['private_say_commands']:

        # Register the private user settings say commands
        say_command_manager.register_commands(_core_settings[
            'USER_SETTINGS']['private_say_commands'].split(
            ','), _player_settings._private_send_menu)

    # Are there any public user settings say commands?
    if _core_settings['USER_SETTINGS']['public_say_commands']:

        # Register the public user settings say commands
        say_command_manager.register_commands(_core_settings[
            'USER_SETTINGS']['public_say_commands'].split(
            ','), _player_settings._send_menu)

    # Are there any client user settings commands?
    if _core_settings['USER_SETTINGS']['client_commands']:

        # Register the client user settings commands
        client_command_manager.register_commands(_core_settings[
            'USER_SETTINGS']['client_commands'].split(
            ','), _player_settings._send_menu)
Ejemplo n.º 2
0
def setup_user_settings():
    """Set up user settings."""
    _sp_logger.log_debug('Setting up user settings...')

    from commands.client import client_command_manager
    from commands.say import say_command_manager
    from settings.menu import _player_settings
    from core.settings import _core_settings

    # Are there any private user settings say commands?
    if _core_settings['USER_SETTINGS']['private_say_commands']:

        # Register the private user settings say commands
        say_command_manager.register_commands(
            _core_settings['USER_SETTINGS']['private_say_commands'].split(','),
            _player_settings._private_send_menu)

    # Are there any public user settings say commands?
    if _core_settings['USER_SETTINGS']['public_say_commands']:

        # Register the public user settings say commands
        say_command_manager.register_commands(
            _core_settings['USER_SETTINGS']['public_say_commands'].split(','),
            _player_settings._send_menu)

    # Are there any client user settings commands?
    if _core_settings['USER_SETTINGS']['client_commands']:

        # Register the client user settings commands
        client_command_manager.register_commands(
            _core_settings['USER_SETTINGS']['client_commands'].split(','),
            _player_settings._send_menu)
Ejemplo n.º 3
0
    def register_commands(self):
        """Register the public, private, and client commands."""
        for command in self.commands:
            # Register the public commands
            say_command_manager.register_commands(
                (command, '!' + command),
                _send_command_menu,
            )

            # Register the private command
            say_command_manager.register_commands(
                '/' + command,
                _send_command_menu,
            )

            # Register the client command
            client_command_manager.register_commands(
                command,
                _send_command_menu,
            )