telegram-shell-bot icon indicating copy to clipboard operation
telegram-shell-bot copied to clipboard

bot.py fails with type error "object is not subscriptable" line 78

Open bensig opened this issue 2 years ago • 3 comments

Python 3.8.0 Poetry (version 1.3.2)

Traceback (most recent call last):
  File "bot.py", line 78, in <module>
    def __is_out_all(cmd: str) -> tuple[str, bool]:
TypeError: 'type' object is not subscriptable

bensig avatar Feb 01 '23 00:02 bensig

Installed miniconda - running python 3.10 now getting new errors about missing modules.

ModuleNotFoundError: No module named 'delegator'
ModuleNotFoundError: No module named 'telegram'

Installed those with pip, new errors:

Traceback (most recent call last):
  File "/home/ben/src/telegram-shell-bot/bot.py", line 7, in <module>
    from telegram import InlineKeyboardButton, InlineKeyboardMarkup, constants
ImportError: cannot import name 'InlineKeyboardButton' from 'telegram' (/home/ben/miniconda3/lib/python3.10/site-packages/telegram/__init__.py)

bensig avatar Feb 01 '23 01:02 bensig

The correct dependance is

python-telegram-bot = "^13.14"
"delegator.py" = "^0.1.1"

vicalloy avatar Feb 01 '23 02:02 vicalloy

Same errors here, i checked pyproject.toml and contains the information that @vicalloy mention:

pyproject.toml:python-telegram-bot = "^13.14"
pyproject.toml:"delegator.py" = "^0.1.1"

Any solution ?

telekomancer avatar Feb 14 '23 15:02 telekomancer