mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot.git
synced 2024-11-22 23:21:28 +00:00
Compare commits
No commits in common. "7930d5d996723b95139295e7e237423c74682b4e" and "63f94ed574b99eb998ff018b4117817f831d479c" have entirely different histories.
7930d5d996
...
63f94ed574
|
@ -1 +0,0 @@
|
|||
FMN_prev.webp
|
Before Width: | Height: | Size: 13 B After Width: | Height: | Size: 98 KiB |
BIN
src/FMN.webp
Normal file
BIN
src/FMN.webp
Normal file
Binary file not shown.
Before Width: | Height: | Size: 13 B After Width: | Height: | Size: 98 KiB |
Binary file not shown.
Before Width: | Height: | Size: 98 KiB |
|
@ -80,7 +80,7 @@ def get_status(status_id):
|
|||
logger.info(f'Retrying get status {status_id}')
|
||||
|
||||
|
||||
def post_status(text, reply_to_status_id=None, poll_options=None, poll_expires=345600, attachments=None, visibility='unlisted'):
|
||||
def post_status(text, reply_to_status_id=None, poll_options=None, poll_expires=345600, attachments=None):
|
||||
poll = None
|
||||
if poll_options is not None:
|
||||
poll = {
|
||||
|
@ -91,7 +91,7 @@ def post_status(text, reply_to_status_id=None, poll_options=None, poll_expires=3
|
|||
params = {
|
||||
"status": text,
|
||||
"in_reply_to_id": reply_to_status_id,
|
||||
"visibility": visibility,
|
||||
"visibility": "unlisted",
|
||||
"content_type": "text/plain",
|
||||
"language": "ru",
|
||||
"poll": poll
|
||||
|
|
|
@ -58,33 +58,6 @@ def get_control_mention():
|
|||
time.sleep(0.2)
|
||||
mark_as_read_notification(i['id'])
|
||||
|
||||
states_stor.states['max_mute_time'] = int(max_mute_time)
|
||||
states_stor.states['stop_thread_scan'] = int(stop_thread_scan)
|
||||
states_stor.states['last_thread_id'] = st_id
|
||||
write_states(states_stor.states)
|
||||
break
|
||||
if now_hour == 0:
|
||||
logger.warning(f'Автоматический триггер в полночи сработал')
|
||||
st_date = time_now
|
||||
thread_created_at = dateutilparse(st_date)
|
||||
|
||||
delta = relativedelta(hour=hour_poll_posting, minute=0, second=0, weekday=TU(1))
|
||||
stop_thread_scan = thread_created_at + delta
|
||||
movies_accept_time = stop_thread_scan.strftime('%H:%M %d.%m.%Y по Москве')
|
||||
stop_thread_scan = time.mktime(time.struct_time(stop_thread_scan.timetuple()))
|
||||
|
||||
if now_week == 6: # Фикс стыков двух недель. Если вс, то расчитываем на следующую неделю
|
||||
next_week = 2
|
||||
else:
|
||||
next_week = 1
|
||||
next_movie_watching_delta = relativedelta(hour=fmn_next_watching_hour, minute=0, second=0, weekday=SU(next_week))
|
||||
next_movie_watching = time_now + next_movie_watching_delta
|
||||
max_mute_time = time.mktime(time.struct_time(next_movie_watching.timetuple())) # Глушение до следующего сеанса FMN.
|
||||
next_movie_watching = next_movie_watching.strftime('%d.%m.%Y')
|
||||
st_id = post_status(start_collect_movies_text(movies_accept_time, next_movie_watching) + '\n\n@rf@mastodon.ml', None, attachments=[upload_attachment('src/FMN.webp')], "public")['id']
|
||||
|
||||
time.sleep(0.2)
|
||||
|
||||
states_stor.states['max_mute_time'] = int(max_mute_time)
|
||||
states_stor.states['stop_thread_scan'] = int(stop_thread_scan)
|
||||
states_stor.states['last_thread_id'] = st_id
|
||||
|
|
Loading…
Reference in a new issue