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()