diff --git a/.gitignore b/.gitignore index d558a03..c0ad412 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ venv/ -.env \ No newline at end of file +.env +eightyk diff --git a/main.py b/main.py index 4ecadc0..8c1c518 100644 --- a/main.py +++ b/main.py @@ -21,7 +21,13 @@ def postStatus(): status = "" if int(price) >= 80000: - status = f"현재 삼성전자의 주가는 {price}원 입니다.\n드디어 팔만전자를 달성했습니다!" + try: + open("eightyk", "r") + status = f"현재 삼성전자의 주가는 {price}원 입니다." + except: + status = f"현재 삼성전자의 주가는 {price}원 입니다.\n드디어 팔만전자를 달성했습니다!" + open("eightyk", "x") + else: delta_to_80000 = 80000 - int(price) status = f"현재 삼성전자의 주가는 {price}원 입니다.\n팔만전자까지 {delta_to_80000}원 남았습니다." @@ -38,6 +44,7 @@ def postStatus(): if __name__ == "__main__": sched = BlockingScheduler() - # sched.add_job(postStatus, "cron", hour="15", minute="8", id="job1") - sched.add_job(postStatus, "cron", hour="10,12,16", id="job1") + sched.add_job(postStatus, "cron", hour="10,12,16", day_of_week="0-4", id="job1") sched.start() + print("The bot is started!") +