-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush.py
More file actions
33 lines (22 loc) · 674 Bytes
/
push.py
File metadata and controls
33 lines (22 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from flask import Flask, request, abort
from linebot import (
LineBotApi
)
from linebot.models import (
TextSendMessage
)
import schedule, time
from app import line_bot_api
def load_subscribers():
f = open("data/userId.txt", "r")
return f.readlines()
subscribers = load_subscribers()
def push_daily_report():
# Send push messages to all users which added the bot as a friend
line_bot_api.broadcast(messages=TextSendMessage(text="Daily broadcast!"))
if __name__ == "__main__":
push_daily_report()
# schedule.every().day.at("09:00").do(push_daily_report)
# while True:
# schedule.run_pending()
# time.sleep(1)