This commit is contained in:
0815Cracky
2024-02-27 11:46:37 +01:00
parent 6053e255ad
commit ff22f47b90
60 changed files with 7183 additions and 0 deletions

View File

@ -0,0 +1,30 @@
from textwrap import dedent
import requests
from TwitchChannelPointsMiner.classes.Settings import Events
class Pushover(object):
__slots__ = ["userkey", "token", "priority", "sound", "events"]
def __init__(self, userkey: str, token: str, priority, sound, events: list):
self.userkey = userkey
self.token = token
self. priority = priority
self.sound = sound
self.events = [str(e) for e in events]
def send(self, message: str, event: Events) -> None:
if str(event) in self.events:
requests.post(
url="https://api.pushover.net/1/messages.json",
data={
"user": self.userkey,
"token": self.token,
"message": dedent(message),
"title": "Twitch Channel Points Miner",
"priority": self.priority,
"sound": self.sound,
},
)