Following the steps from this repository resulted in the following error message:
$ python ./echobot.py init DCACCOUNT:https://nine.testrun.org/new
Traceback (most recent call last):
File "/root/deltachat-bot/./echobot.py", line 5, in <module>
from deltachat2 import MsgData, events
ImportError: cannot import name 'MsgData' from 'deltachat2' (/root/user/.venv/lib/python3.13/site-packages/deltachat2/__init__.py)
Looking into the repository of the Python library shows that the code has to be changed:
Working version of echobot.py:
#!/usr/bin/env python3
from deltachat2 import MessageData, events
from deltabot_cli import BotCli
cli = BotCli("echobot")
@cli.on(events.RawEvent)
def log_event(bot, accid, event):
bot.logger.info(event)
@cli.on(events.NewMessage)
def echo(bot, accid, event):
msg = event.msg
bot.rpc.send_msg(accid, msg.chat_id, MessageData(text=msg.text))
if __name__ == "__main__":
cli.start()
Following the steps from this repository resulted in the following error message:
Looking into the repository of the Python library shows that the code has to be changed:
Working version of echobot.py: