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