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)