netflix-clicker/line_notifier.py
2024-03-31 19:48:36 +08:00

17 lines
393 B
Python

import requests
import os
class LineNotifier:
def __init__(self) -> None:
self.url = 'https://notify-api.line.me/api/notify'
self.headers = {
'Authorization': 'Bearer ' + os.environ['LINE_TOKEN']
}
def notify(self, msg: str):
data = {
'message': msg,
}
requests.post(self.url, headers=self.headers, data=data)