Skip to content
Snippets Groups Projects
Commit bba5e99b authored by overflow's avatar overflow
Browse files

bot joins room

parent 276fd724
Branches
No related tags found
1 merge request!3Project structure
......@@ -10,16 +10,19 @@ def on_message(room, event):
if event['content']['msgtype'] == "m.text":
print("{0}: {1}".format(event['sender'], event['content']['body']))
def main():
client = MatrixClient("https://matrix.org")
token = client.login(username="foss-ag_klo", password=os.environ['KLO_PW'])
room = client.join_room("#klotest:matrix.org")
room.add_listener(on_message)
client.start_listener_thread()
while True:
pass
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment