telegram-bots / imaginaryfriend

:rocket: Telegram bot
46 stars 18 forks source link

ValueError: invalid literal for int() with base 10: '' #57

Open FabioNevesRezende opened 5 years ago

FabioNevesRezende commented 5 years ago

I've just followed the step to install and setup using docker, when I run docker-compose up it fails with:

bot_1 | Traceback (most recent call last): bot_1 | File "run.py", line 3, in bot_1 | from src.bot import Bot bot_1 | File "/code/src/bot.py", line 6, in bot_1 | from src.handler import * bot_1 | File "/code/src/handler/init.py", line 1, in bot_1 | from .command_handler import CommandHandler bot_1 | File "/code/src/handler/command_handler.py", line 7, in bot_1 | from .commands import commands bot_1 | File "/code/src/handler/commands/init.py", line 5, in bot_1 | from src.handler.commands.moderate import Moderate bot_1 | File "/code/src/handler/commands/moderate.py", line 5, in bot_1 | class Moderate(Base): bot_1 | File "/code/src/handler/commands/moderate.py", line 7, in Moderate bot_1 | gods = config.getlist('bot', 'god_mode', type=int) bot_1 | File "/code/src/config.py", line 18, in getlist bot_1 | return list(map(lambda o: type(o), config.get(section, option).split(','))) bot_1 | File "/code/src/config.py", line 18, in bot_1 | return list(map(lambda o: type(o), config.get(section, option).split(','))) bot_1 | ValueError: invalid literal for int() with base 10: '' imaginaryfriend_bot_1 exited with code 1

mikekytyzov commented 5 years ago

i tried to run from docker but it doesnt work

i give to you my solution with the same problem

add key to config [bot] god_mode=some_integer

and the second - i am not python programmer but i just replace a get_list from config.py

def getlist(self, section, option, type=str):
    def handler(o):
      return type(o)
    el_list = config.get(section, option).split(',')
    mapped = map(handler, el_list)
    return list(mapped)

and it works

matheusbach commented 3 years ago

works for me