v0.1.2 #60
8
main.py
8
main.py
@ -35,14 +35,16 @@ with contextlib.suppress(ImportError):
|
||||
|
||||
|
||||
def main():
|
||||
if args.migrate:
|
||||
migrate_database()
|
||||
logger.info("Migration finished. Exiting...")
|
||||
exit()
|
||||
|
||||
client = PyroClient(
|
||||
scheduler=scheduler, commands_source=sync.json_read(Path("commands.json"))
|
||||
)
|
||||
Conversation(client)
|
||||
|
||||
if args.migrate:
|
||||
migrate_database()
|
||||
|
||||
try:
|
||||
client.run()
|
||||
except KeyboardInterrupt:
|
||||
|
16
migrations/202405261500.py
Normal file
16
migrations/202405261500.py
Normal file
@ -0,0 +1,16 @@
|
||||
from libbot import sync
|
||||
from mongodb_migrations.base import BaseMigration
|
||||
|
||||
|
||||
class Migration(BaseMigration):
|
||||
def upgrade(self):
|
||||
sync.config_set("update_checker", True)
|
||||
sync.config_set(
|
||||
"url_updater",
|
||||
"https://git.end-play.xyz/api/v1/repos/GarbageReminder/TelegramBot/releases/latest",
|
||||
"strings",
|
||||
)
|
||||
|
||||
def downgrade(self):
|
||||
sync.config_delete("update_checker", missing_ok=True)
|
||||
sync.config_delete("url_updater", "strings")
|
Reference in New Issue
Block a user