Prototype assertions + New Year

This commit is contained in:
Egor Guslyancev 2023-12-31 19:15:15 -03:00
parent ee782b154e
commit b3586dc5cd
GPG Key ID: D7E709AA465A55F9
2 changed files with 10 additions and 2 deletions

7
bot.py
View File

@ -19,7 +19,7 @@ import timeout as tmo
# TODO more backends (redis at least)
db = db_classes.PickleDB(".db")
db.load()
CURRENT_VERSION = "v1.0rc10"
CURRENT_VERSION = "v1.0rc11"
VERSION = db.read("about.version", CURRENT_VERSION)
db.write("about.author", "electromagneticcyclone")
db.write("about.tester", "angelbeautifull")
@ -1414,7 +1414,10 @@ def update_notify(forum: int) -> None:
"Notifies the forum about bot's new version."
bot.reply_to(
get_chat(forum),
f"Обновился до версии {telebot.formatting.escape_markdown(CURRENT_VERSION)}",
# f"Обновился до версии {telebot.formatting.escape_markdown(CURRENT_VERSION)}",
f"Обновился до версии {telebot.formatting.escape_markdown(CURRENT_VERSION)}\n"
+ "Дежурик поздравляет всех бета-тестеров с НовЫыыым Г0йда и напоминает о том,"
+ " что на каникулах и сессии дежурства продолжаются",
)

View File

@ -16,18 +16,23 @@ class PrototypeDB:
def save(self, dbfo: str = None):
"Export database to the file."
raise AssertionError("Unimplemented method")
def load(self, dbfi: str = None):
"Import database from the file."
raise AssertionError("Unimplemented method")
def write(self, field: str, value: any, data=None):
"Write `value` to the database's `field`. `data` argument is not used. Returns new db."
raise AssertionError("Unimplemented method")
def read(self, field: str, default: any = None, data=None) -> any:
"Read `field` from the database. `default` argument returned when where's no such a field."
raise AssertionError("Unimplemented method")
def pop(self, field: str) -> any:
"Remove `field` from the database."
raise AssertionError("Unimplemented method")
class PickleDB(PrototypeDB):