vicalloy / telegram-shell-bot

A telegram Bot to run shell commands
194 stars 83 forks source link

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

Open bensig opened 1 year ago

bensig commented 1 year ago

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 commented 1 year ago

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)
vicalloy commented 1 year ago

The correct dependance is

python-telegram-bot = "^13.14"
"delegator.py" = "^0.1.1"
telekomancer commented 1 year ago

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 ?