import requests,time class ntfy: @classmethod def sendMsg(cls, msg,alert=True,sleep=None,error=None): try: print(f"#ntfy: {msg}") if alert: requests.post("https://ntfy.caiwenxiu.cn/PyComic", data=msg.encode(encoding='utf-8')) except: print(f"#ntfy error: {msg}") if sleep != None: time.sleep(int(sleep)) if error != None: print(f"#ntfy Error: {error}") return False else: return True