Add discord notification
This commit is contained in:
parent
3ac53d76d0
commit
20b42fee2c
|
@ -130,5 +130,5 @@ dmypy.json
|
|||
.pyre/
|
||||
|
||||
# Ignore config
|
||||
conf/kimsufi.yaml
|
||||
config/kimsufi.yaml
|
||||
db.sqlite
|
||||
|
|
|
@ -34,4 +34,7 @@ notifications:
|
|||
host: domain.tld
|
||||
thumbnail: True
|
||||
room_id: !12546789:domain.tld
|
||||
discord:
|
||||
webhookid: 123
|
||||
webhooktoken: 567
|
||||
db: db.sqlite
|
||||
|
|
|
@ -35,8 +35,8 @@ class Notifications:
|
|||
def run(self, server, datacenter):
|
||||
refOfServer = Settings().get("config/refToName.yml")
|
||||
self.apprise.notify(
|
||||
body="{} is available {}".format(refOfServer[server], datacenter),
|
||||
title="{} is available \o/".format(refOfServer[server], datacenter),
|
||||
body="",
|
||||
title="Le serveur {} disponible au datacenter de {}".format(refOfServer[server], datacenter),
|
||||
notify_type=apprise.NotifyType.INFO,
|
||||
)
|
||||
|
||||
|
@ -77,7 +77,12 @@ class Notifications:
|
|||
)
|
||||
|
||||
def _addDiscord(self):
|
||||
return True
|
||||
self.apprise.add(
|
||||
"discord://{}/{}/".format(
|
||||
self.config["discord"]["webhookid"],
|
||||
self.config["discord"]["webhooktoken"],
|
||||
)
|
||||
)
|
||||
|
||||
def _addMatrix(self):
|
||||
self.apprise.add(
|
||||
|
@ -88,4 +93,3 @@ class Notifications:
|
|||
self.config["matrix"]["room_id"],
|
||||
)
|
||||
)
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue