matrix-org / matrix-python-sdk

Matrix Client-Server SDK for Python 2 and 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple example to call my bot

n1ghthunt3r opened this issue · comments

Anybody has an example of code (something very simple) so I can study? I can't start with complex things, I'm newbie in programming and these big codes kind of mess everything in my head lol. I'm trying to create a simple code where user call the bot on the room using a simple command, for example: /botname and the bot answer with "hello user xxxx". I'm trying to do in python but something very, very simple but no success until now.

Thanks in advance.

Just replace line 30 here with something like:

if event['content']['body'].startswith('/botname'):
    room.send_message("hello user " + event['sender'])

In the future, use the matrix-python-sdk room for support questions.

thanks