mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot
synced 2024-11-22 20:59:24 +02:00
Reaction on mentions only in monday,sunday
This commit is contained in:
parent
4d9a30c5f5
commit
600b022e8a
|
@ -11,9 +11,16 @@ acct_admin_bot=main_admin_bot
|
||||||
|
|
||||||
def get_control_mention(acct_admin_bot=str):
|
def get_control_mention(acct_admin_bot=str):
|
||||||
while True:
|
while True:
|
||||||
|
now_week = datetime.now().weekday()
|
||||||
|
if now_week not in (0, 6):
|
||||||
|
time.sleep(30)
|
||||||
|
continue
|
||||||
notif = get_notifications()
|
notif = get_notifications()
|
||||||
for i in notif:
|
for i in notif:
|
||||||
if i['account']['acct'] == acct_admin_bot and i['pleroma']['is_seen'] == False and i['status']['in_reply_to_id'] == None:
|
seen = i['pleroma']['is_seen']
|
||||||
|
acct_mention = i['account']['acct']
|
||||||
|
reply_to_id = i['status']['in_reply_to_id']
|
||||||
|
if acct_mention == acct_admin_bot and seen == False and reply_to_id == None and now_week in (0, 6):
|
||||||
st_id = i['status']['id']
|
st_id = i['status']['id']
|
||||||
st_date = i['status']['created_at']
|
st_date = i['status']['created_at']
|
||||||
thread_created_at = dateutilparse(st_date)
|
thread_created_at = dateutilparse(st_date)
|
||||||
|
|
Loading…
Reference in New Issue