From 04726d77c19862d46ec39c05e4781a4a307d9a15 Mon Sep 17 00:00:00 2001 From: Gabriel Wilson Date: Wed, 23 Feb 2022 03:47:03 -0500 Subject: [PATCH] simple stuff --- .gitignore | 3 ++- main.py | 11 ++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 114ea57..6c31354 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -data.json \ No newline at end of file +data.json +session.txt \ No newline at end of file diff --git a/main.py b/main.py index 8d14c7c..3b54cb4 100644 --- a/main.py +++ b/main.py @@ -32,7 +32,7 @@ async def faq(room, message): @bot.listener.on_custom_event(nio.InviteMemberEvent) -async def autofaq(room, event): +async def example(room, event): if event.membership == "join": await bot.api.send_markdown_message( room.room_id, @@ -50,17 +50,14 @@ async def faqresponse(room, message): if match.is_not_from_this_bot(): response = "" questions = get_questions() - print("Message:",message) for q in questions: if sum([ 1 for kp in q["key_phrases"] if kp in message.body]) == len(q["key_phrases"]): - response = response + q["question"] + "\n" + q["answer"]+"\n" + response += q["question"] + "\n" + q["answer"]+"\n" if response != "": await bot.api.send_markdown_message( room.room_id, - response + response + dfaq["footer"] ) + - - - bot.run()