Beispiel #1
0
    def bot_config(name):
        config = AutosaveDict('bots/%s.json' % name)

        i = 1
        finished = False
        while not finished:
            text = 'Editing /bots/%s.json\n' % name

            if 'bindings' in config:
                bindings = config['bindings']
            else:
                bindings = 'telegram-bot-api'

            if 'bindings_token' in config:
                bindings_token = config['bindings_token']
            else:
                bindings_token = 'YOUR TELEGRAM BOT TOKEN'

            if 'command_start' in config:
                command_start = config['command_start']
            else:
                command_start = '/'

            if 'owner' in config:
                owner = config['owner']
            else:
                owner = 0

            if 'debug' in config:
                debug = config['debug']
            else:
                debug = False

            if 'language' in config:
                language = config['language']
            else:
                language = 'default'

            if 'plugins' in config:
                plugins = config['plugins']
            else:
                plugins = load_plugin_list()

            if 'api_keys' in config:
                api_keys = config['api_keys']
            else:
                api_keys = {}

            text += '(0) Finish editing\n'
            text += '(1) bindings: %s\n' % bindings
            text += '(2) bindings_token: %s\n' % bindings_token
            text += '(3) command_start: %s\n' % command_start
            text += '(4) owner: %s\n' % owner
            text += '(5) debug: %s\n' % debug
            text += '(6) language: %s\n' % language
            text += '(7) plugins: %s\n' % plugins
            text += '(8) api_keys: %s\n' % api_keys

            option = int(input(text))
            if option == 0:
                print('Saving all values to "bots/%s.json".' % name)
                config.bindings = bindings
                config.bindings_token = bindings_token
                config.command_start = command_start
                config.owner = owner
                config.debug = debug
                config.language = language
                config.plugins = plugins
                config.api_keys = api_keys
                finished = True

            elif option == 1:
                option = input(
                    'What bindings want to use? (Current value: "%s")\n' %
                    bindings)
                config.bindings = option
Beispiel #2
0
    def bot_config(name):
        config = AutosaveDict('bots/%s.json' % name)

        i = 1
        finished = False
        while not finished:
            text = 'Editing /bots/%s.json\n' % name

            if 'bindings' in config:
                bindings = config['bindings']
            else:
                bindings = 'telegram-bot-api'

            if 'bindings_token' in config:
                bindings_token = config['bindings_token']
            else:
                bindings_token = 'YOUR TELEGRAM BOT TOKEN'

            if 'command_start' in config:
                command_start = config['command_start']
            else:
                command_start = '/'

            if 'owner' in config:
                owner = config['owner']
            else:
                owner = 0

            if 'debug' in config:
                debug = config['debug']
            else:
                debug = False

            if 'language' in config:
                language = config['language']
            else:
                language = 'default'

            if 'plugins' in config:
                plugins = config['plugins']
            else:
                plugins = load_plugin_list()

            if 'api_keys' in config:
                api_keys = config['api_keys']
            else:
                api_keys = {}

            text += '(0) Finish editing\n'
            text += '(1) bindings: %s\n' % bindings
            text += '(2) bindings_token: %s\n' % bindings_token
            text += '(3) command_start: %s\n' % command_start
            text += '(4) owner: %s\n' % owner
            text += '(5) debug: %s\n' % debug
            text += '(6) language: %s\n' % language
            text += '(7) plugins: %s\n' % plugins
            text += '(8) api_keys: %s\n' % api_keys

            option = int(input(text))
            if option == 0:
                print('Saving all values to "bots/%s.json".' % name)
                config.bindings = bindings
                config.bindings_token = bindings_token
                config.command_start = command_start
                config.owner = owner
                config.debug = debug
                config.language = language
                config.plugins = plugins
                config.api_keys = api_keys
                finished = True
            
            elif option == 1:
                option = input('What bindings want to use? (Current value: "%s")\n' % bindings)
                config.bindings = option