fun upd
This commit is contained in:
@@ -195,6 +195,9 @@ def new_message(message: types.Message) -> int:
|
|||||||
def check_old_notes() -> list[int, str, int]: # возвращает первую устаревшую заметку
|
def check_old_notes() -> list[int, str, int]: # возвращает первую устаревшую заметку
|
||||||
users = yaml.safe_load(open(users_path, "r", encoding="utf-8"))
|
users = yaml.safe_load(open(users_path, "r", encoding="utf-8"))
|
||||||
|
|
||||||
|
if not users:
|
||||||
|
users = {}
|
||||||
|
|
||||||
for user_id in users.keys():
|
for user_id in users.keys():
|
||||||
notes = yaml.safe_load(open(user_path.format(user_id), "r", encoding="utf-8"))
|
notes = yaml.safe_load(open(user_path.format(user_id), "r", encoding="utf-8"))
|
||||||
|
|
||||||
|
|||||||
@@ -13,3 +13,80 @@
|
|||||||
\nПожалуйста, попробуйте снова или свяжитесь с @Kr0sH_512"
|
\nПожалуйста, попробуйте снова или свяжитесь с @Kr0sH_512"
|
||||||
no_reminders: "У вас нет напоминаний."
|
no_reminders: "У вас нет напоминаний."
|
||||||
not_registered: "Пожалуйста, воспользуйтесь сперва командой /start"
|
not_registered: "Пожалуйста, воспользуйтесь сперва командой /start"
|
||||||
|
|
||||||
|
"list_reaction":
|
||||||
|
[
|
||||||
|
"👍",
|
||||||
|
"👎",
|
||||||
|
"❤",
|
||||||
|
"🔥",
|
||||||
|
"🥰",
|
||||||
|
"👏",
|
||||||
|
"😁",
|
||||||
|
"🤔",
|
||||||
|
"🤯",
|
||||||
|
"😱",
|
||||||
|
"🤬",
|
||||||
|
"😢",
|
||||||
|
"🎉",
|
||||||
|
"🤩",
|
||||||
|
"🤮",
|
||||||
|
"💩",
|
||||||
|
"🙏",
|
||||||
|
"👌",
|
||||||
|
"🕊",
|
||||||
|
"🤡",
|
||||||
|
"🥱",
|
||||||
|
"🥴",
|
||||||
|
"😍",
|
||||||
|
"🐳",
|
||||||
|
"❤🔥",
|
||||||
|
"🌚",
|
||||||
|
"🌭",
|
||||||
|
"💯",
|
||||||
|
"🤣",
|
||||||
|
"⚡",
|
||||||
|
"🍌",
|
||||||
|
"🏆",
|
||||||
|
"💔",
|
||||||
|
"🤨",
|
||||||
|
"😐",
|
||||||
|
"🍓",
|
||||||
|
"🍾",
|
||||||
|
"💋",
|
||||||
|
"🖕",
|
||||||
|
"😈",
|
||||||
|
"😴",
|
||||||
|
"😭",
|
||||||
|
"🤓",
|
||||||
|
"👻",
|
||||||
|
"👨💻",
|
||||||
|
"👀",
|
||||||
|
"🎃",
|
||||||
|
"🙈",
|
||||||
|
"😇",
|
||||||
|
"😨",
|
||||||
|
"🤝",
|
||||||
|
"✍",
|
||||||
|
"🤗",
|
||||||
|
"🫡",
|
||||||
|
"🎅",
|
||||||
|
"🎄",
|
||||||
|
"☃",
|
||||||
|
"💅",
|
||||||
|
"🤪",
|
||||||
|
"🗿",
|
||||||
|
"🆒",
|
||||||
|
"💘",
|
||||||
|
"🙉",
|
||||||
|
"🦄",
|
||||||
|
"😘",
|
||||||
|
"💊",
|
||||||
|
"🙊",
|
||||||
|
"😎",
|
||||||
|
"👾",
|
||||||
|
"🤷♂",
|
||||||
|
"🤷",
|
||||||
|
"🤷♀",
|
||||||
|
"😡",
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
#!/usr/bin/python3.3
|
#!/usr/bin/python3.3
|
||||||
import threading, telebot, schedule, time, yaml
|
import threading, telebot, schedule, time, yaml
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import os, sys, inspect
|
import os, sys, inspect, random
|
||||||
import re, locale
|
import re, locale
|
||||||
from telegram.constants import ParseMode
|
from telegram.constants import ParseMode
|
||||||
from telebot import types
|
from telebot import types
|
||||||
import for_db as db
|
import for_db as db
|
||||||
|
|
||||||
config = yaml.safe_load(open("config.yaml"))
|
config = yaml.safe_load(open("config.yaml"))
|
||||||
lang = yaml.safe_load(open("lang.yaml"))["ru"]
|
lang = yaml.safe_load(open("lang.yaml", encoding="utf-8"))["ru"]
|
||||||
|
list_reactions = yaml.safe_load(open("lang.yaml", encoding="utf-8"))["list_reaction"]
|
||||||
bot = telebot.TeleBot(
|
bot = telebot.TeleBot(
|
||||||
config["api_token"],
|
config["api_token"],
|
||||||
colorful_logs=True,
|
colorful_logs=True,
|
||||||
@@ -310,6 +311,11 @@ def list_notes(message: types.Message, list: str = "Default", edit: bool = False
|
|||||||
|
|
||||||
msg = send_message(message, notes_msg, markup)
|
msg = send_message(message, notes_msg, markup)
|
||||||
|
|
||||||
|
reaction = types.ReactionTypeEmoji(random.choice(list_reactions))
|
||||||
|
bot.set_message_reaction(
|
||||||
|
message.chat.id, message.message_id, [reaction], is_big=True
|
||||||
|
)
|
||||||
|
|
||||||
old_msg_id = db.new_message(msg)
|
old_msg_id = db.new_message(msg)
|
||||||
|
|
||||||
if old_msg_id:
|
if old_msg_id:
|
||||||
@@ -397,6 +403,11 @@ def text_message(message: types.Message):
|
|||||||
date_found_dt,
|
date_found_dt,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
reaction = types.ReactionTypeEmoji(random.choice(list_reactions))
|
||||||
|
|
||||||
|
bot.set_message_reaction(
|
||||||
|
message.chat.id, message.message_id, [reaction], is_big=True
|
||||||
|
)
|
||||||
send_message(message, "📝 Напоминание добавлено:")
|
send_message(message, "📝 Напоминание добавлено:")
|
||||||
list_notes(message)
|
list_notes(message)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user