Load hooks from file
This commit is contained in:
2
server/src/hooks.yml
Normal file
2
server/src/hooks.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
2345555XE: "#Bottest"
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user