remove pro only feature
This commit is contained in:
parent
d99f70096f
commit
ca9156e5b9
@ -77,7 +77,7 @@ async def push_notification(title, text, user_id):
|
|||||||
response = requests.post(url, headers=headers, data=json.dumps(data))
|
response = requests.post(url, headers=headers, data=json.dumps(data))
|
||||||
|
|
||||||
|
|
||||||
async def push_wiim(user_id, is_pro=False):
|
async def push_wiim(user_id):
|
||||||
"""
|
"""
|
||||||
Pushes the latest WIIM news based on users' watchlists.
|
Pushes the latest WIIM news based on users' watchlists.
|
||||||
|
|
||||||
@ -122,7 +122,8 @@ async def push_wiim(user_id, is_pro=False):
|
|||||||
|
|
||||||
notify_item = pb.collection('notifications').create(newNotification)
|
notify_item = pb.collection('notifications').create(newNotification)
|
||||||
|
|
||||||
if is_pro == True:
|
#if is_pro == True:
|
||||||
|
|
||||||
check_subscription = pb.collection("pushSubscription").get_full_list(query_params={"filter": f"user='{user_id}'"})
|
check_subscription = pb.collection("pushSubscription").get_full_list(query_params={"filter": f"user='{user_id}'"})
|
||||||
user_subscribed = False
|
user_subscribed = False
|
||||||
for item in check_subscription:
|
for item in check_subscription:
|
||||||
@ -141,8 +142,8 @@ async def run():
|
|||||||
all_users = pb.collection("users").get_full_list()
|
all_users = pb.collection("users").get_full_list()
|
||||||
for item in tqdm(all_users):
|
for item in tqdm(all_users):
|
||||||
user_id = item.id
|
user_id = item.id
|
||||||
is_pro = True if item.tier == 'Pro' else False
|
#is_pro = True if item.tier == 'Pro' else False
|
||||||
await push_wiim(user_id=user_id, is_pro=is_pro)
|
await push_wiim(user_id=user_id)
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user