mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot
synced 2024-11-22 16:19:22 +02:00
added display name watched movie (in forgot case)
This commit is contained in:
parent
7930d5d996
commit
3ad6b279d7
|
@ -4,12 +4,20 @@ from config import admins_bot, limit_movies_per_user, limit_all_movies_poll, hou
|
||||||
|
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
import requests
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from dateutil.parser import parse as dateutilparse
|
from dateutil.parser import parse as dateutilparse
|
||||||
from dateutil.relativedelta import relativedelta, TU, SU
|
from dateutil.relativedelta import relativedelta, TU, SU
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
|
|
||||||
|
@logger.catch
|
||||||
|
def get_peertube_stream_name():
|
||||||
|
try:
|
||||||
|
return requests.get("https://xxivproduction.video/api/v1/videos/1FZeVVVzWBFShaxQVkYiXd").json()['name']
|
||||||
|
except:
|
||||||
|
return "[не удалось получить название]"
|
||||||
|
|
||||||
@logger.catch
|
@logger.catch
|
||||||
def get_control_mention():
|
def get_control_mention():
|
||||||
while True:
|
while True:
|
||||||
|
@ -81,7 +89,8 @@ def get_control_mention():
|
||||||
next_movie_watching = time_now + next_movie_watching_delta
|
next_movie_watching = time_now + next_movie_watching_delta
|
||||||
max_mute_time = time.mktime(time.struct_time(next_movie_watching.timetuple())) # Глушение до следующего сеанса FMN.
|
max_mute_time = time.mktime(time.struct_time(next_movie_watching.timetuple())) # Глушение до следующего сеанса FMN.
|
||||||
next_movie_watching = next_movie_watching.strftime('%d.%m.%Y')
|
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']
|
watched_movie_name = get_peertube_stream_name()
|
||||||
|
st_id = post_status(f"Спасибо что посмотрели {watched_movie_name}\n\n" + 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)
|
time.sleep(0.2)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue