topkecleon / otouto

A Lua-based Telegram bot with plugins.
http://otou.to
GNU Affero General Public License v3.0
173 stars 112 forks source link

Don't launch. Error in ./otouto/bot.lua:65: #83

Closed ghost closed 7 years ago

ghost commented 7 years ago

If I do not enter the Token, it notifies me that there is no Token. But introducing it gives me this error:

username:~/workspace/otouto (master) $ ./launch.sh Fetching bot information... Missing config value: thecatapi_key. cats.lua will be enabled, but there are more features with a key. lua: ./otouto/bot.lua:65: module 'otouto.plugins.colorhex' not found: no field package.preload['otouto.plugins.colorhex'] no file '/usr/local/share/lua/5.2/otouto/plugins/colorhex.lua' no file '/usr/local/share/lua/5.2/otouto/plugins/colorhex/init.lua' no file '/usr/local/lib/lua/5.2/otouto/plugins/colorhex.lua' no file '/usr/local/lib/lua/5.2/otouto/plugins/colorhex/init.lua' no file '/usr/share/lua/5.2/otouto/plugins/colorhex.lua' no file '/usr/share/lua/5.2/otouto/plugins/colorhex/init.lua' no file './otouto/plugins/colorhex.lua' no file '/usr/local/lib/lua/5.2/otouto/plugins/colorhex.so' no file '/usr/lib/x86_64-linux-gnu/lua/5.2/otouto/plugins/colorhex.so' no file '/usr/lib/lua/5.2/otouto/plugins/colorhex.so' no file '/usr/local/lib/lua/5.2/loadall.so' no file './otouto/plugins/colorhex.so' no file '/usr/local/lib/lua/5.2/otouto.so' no file '/usr/lib/x86_64-linux-gnu/lua/5.2/otouto.so' no file '/usr/lib/lua/5.2/otouto.so' no file '/usr/local/lib/lua/5.2/loadall.so' no file './otouto.so' stack traceback: [C]: in function 'require' ./otouto/bot.lua:65: in function 'init' ./otouto/bot.lua:131: in function <./otouto/bot.lua:130> (...tail calls...) [C]: in ? otouto has stopped. ^C to exit.

The Token has this format: 999999999:AAAAaAA9AA9a9AAaa9AA9AAaaaAa9aa9-9A Obtained via: @BotFather

My config.lua:

-- For details on configuration values, see README.md#configuration.
return {

    -- Your authorization token from the botfather.
    bot_api_key = '999999999:AAAAaAA9AA9a9AAaa9AA9AAaaaAa9aa9-9A', 
    -- Your Telegram ID.
    admin = '999999999', 
    -- Two-letter language code.
    -- Fetches it from the system if available, or defaults to English.
    lang = os.getenv('LANG') and os.getenv('LANG'):sub(1,2) or 'en',
    -- The channel, group, or user to send error reports to.
    -- If this is not set, errors will be printed to the console.
    log_chat = nil,
    -- The port used to communicate with tg for administration.lua.
    -- If you change this, make sure you also modify launch-tg.sh.
    cli_port = 4567,
    -- The symbol that starts a command. Usually noted as '/' in documentation.
    cmd_pat = '/',
    -- If drua is used, should a user be blocked when he's blacklisted?
    drua_block_on_blacklist = false,
    -- The filename of the database. If left nil, defaults to $username.db.
    database_name = nil,
    -- The block of text returned by /start and /about..
    about_text = [[
I am otouto, the plugin-wielding, multipurpose Telegram bot.

Send /help to get started.
    ]],

    errors = { -- Generic error messages.
        generic = 'An unexpected error occurred.',
        connection = 'Connection error.',
        results = 'No results found.',
        argument = 'Invalid argument.',
        syntax = 'Invalid syntax.'
    },

    -- https://datamarket.azure.com/dataset/bing/search
    bing_api_key = nil,
    -- http://console.developers.google.com
    google_api_key = nil,
    -- https://cse.google.com/cse
    google_cse_key = nil,
    -- http://openweathermap.org/appid
    owm_api_key = nil,
    -- http://last.fm/api
    lastfm_api_key = nil,
    -- http://api.biblia.com
    biblia_api_key = nil,
    -- http://thecatapi.com/docs.html
    thecatapi_key = nil,
    -- http://api.nasa.gov
    nasa_api_key = nil,
    -- http://tech.yandex.com/keys/get
    yandex_key = nil,
    -- Interval (in minutes) for hackernews.lua to update.
    hackernews_interval = 60,
    -- Whether hackernews.lua should update at load/reload.
    hackernews_onstart = false,
    -- Whether luarun should use serpent instead of dkjson for serialization.
    luarun_serpent = false,

    remind = {
        persist = true,
        max_length = 1000,
        max_duration = 526000,
        max_reminders_group = 10,
        max_reminders_private = 50
    },

    cleverbot = {
        cleverbot_api = 'https://brawlbot.tk/apis/chatter-bot-api/cleverbot.php?text=',
        connection = 'I don\'t feel like talking right now.',
        response = 'I don\'t know what to say to that.'
    },

    greetings = {
        ["Hello, #NAME."] = {
            "hello",
            "hey",
            "hi",
            "good morning",
            "good day",
            "good afternoon",
            "good evening"
        },
        ["Goodbye, #NAME."] = {
            "good%-?bye",
            "bye",
            "later",
            "see ya",
            "good night"
        },
        ["Welcome back, #NAME."] = {
            "i'm home",
            "i'm back"
        },
        ["You're welcome, #NAME."] = {
            "thanks",
            "thank you"
        }
    },

    reactions = {
        ['shrug'] = '¯\\_(ツ)_/¯',
        ['lenny'] = '( ͡° ͜ʖ ͡°)',
        ['flip'] = '(╯°□°)╯︵ ┻━┻',
        ['look'] = 'ಠ_ಠ',
        ['shots'] = 'SHOTS FIRED',
        ['facepalm'] = '(-‸ლ)'
    },

    administration = {
        -- Conversation, group, or channel for kick/ban notifications.
        -- Defaults to config.log_chat if left empty.
        log_chat = nil,
        -- Default autoban setting.
        -- A user is banned after being autokicked this many times in a day.
        autoban = 3,
        -- Default antiflood values.
        antiflood = {
            text = 5,
            voice = 5,
            audio = 5,
            contact = 5,
            photo = 10,
            video = 10,
            location = 10,
            document = 10,
            sticker = 20
        },
        -- Default flag settings.
        flags = {
            -- unlisted
            [1] = false,
            -- antisquig
            [2] = false,
            -- antisquig++
            [3] = false,
            -- antibot
            [4] = false,
            --antiflood
            [5] = false,
            -- antihammer
            [6] = false,
            -- nokicklog
            [7] = false,
            -- antilink
            [8] = false,
            -- modrights
            [9] = false
        }
    },

    plugins = { -- To enable a plugin, add its name to the list.
        'users',
        'end_forwards',
        'blacklist',
        'about',
        'calc',
        'cats',
        'colorhex',
        'commit',
        'control',
        'currency',
        'dice',
        'echo',
        'eightball',
        'location',
        'hackernews',
        'imdb',
        'me',
        'nick',
        'ping',
        'pun',
        'reddit',
        'shout',
        'slap',
        'time',
        'urbandictionary',
        'whoami',
        'wikipedia',
        'xkcd',
        -- Add new plugins here.
        'help'
    }

}

And my main.lua:

local bot = require('otouto.bot')

local instance = {
    config = require('config')
}

return bot.run(instance)
ghost commented 7 years ago

Solved. Change 'colorhex' to 'hexcolor'

topkecleon commented 7 years ago

Fixed in latest push.