Updates for ravensend

This commit is contained in:
2024-04-08 00:03:30 -05:00
parent 6663651c0b
commit d2fea2be16
3 changed files with 8 additions and 10 deletions

View File

@@ -22,15 +22,13 @@ configvars = []
def hello():
data = request.json
print(data["event"]["message"] + ' at ' + data["event"]["timestamp"])
notification = data["event"]["message"] + ' at ' + data["event"]["timestamp"] + ' -- ' + data["event"]["key"]
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
try:
s.connect((configvars["server"],int(configvars["port"])))
s.settimeout(1)
mesg = configvars["password"] + ' #' + configvars["channel"] + ' ' + data["event"]["message"] + ' at ' + data["event"]["timestamp"]
print(mesg)
mesg = configvars["password"] + ' #' + configvars["channel"] + ' ' + notification
s.send(mesg.encode())
print('Sent to TheRaven')
except:
print('Could not send to TheRaven')
return data