Load hooks from file

This commit is contained in:
2025-01-30 15:47:14 +01:00
parent 20ede6e02a
commit 5af780b3bc
3 changed files with 7 additions and 8 deletions

2
server/src/hooks.yml Normal file
View File

@@ -0,0 +1,2 @@
---
2345555XE: "#Bottest"

View File

@@ -3,12 +3,16 @@ from flask import Flask, request, jsonify
# import asyncio
import websocket
import json
import yaml
import random
app = Flask(__name__)
hooks = {}
hooks['2345555XE'] = '#Bottest'
with open(r'hooks.yml') as hooksfile:
hooks = yaml.load(hooksfile, Loader=yaml.FullLoader)
print(hooks)
#hooks['2345555XE'] = '#Bottest'
def sendmessage(target, message):
print("Sendmessage %s called to %s" % (message, target))