From 834b5cc0f32767c4765e39284ca17dd6788060e0 Mon Sep 17 00:00:00 2001 From: Solumath Date: Mon, 22 Jul 2024 23:34:40 +0200 Subject: [PATCH] remove backup config command --- cogs/dynamicconfig/cog.py | 12 ------------ cogs/dynamicconfig/messages_cz.py | 2 -- 2 files changed, 14 deletions(-) diff --git a/cogs/dynamicconfig/cog.py b/cogs/dynamicconfig/cog.py index b0d91e92c..702591b07 100644 --- a/cogs/dynamicconfig/cog.py +++ b/cogs/dynamicconfig/cog.py @@ -4,7 +4,6 @@ import re import shlex -from datetime import datetime from typing import Any import disnake @@ -103,17 +102,6 @@ async def get( embed = disnake.Embed(title=key, description=str(value)) await inter.send(embed=embed) - @config_cmd.sub_command(description=MessagesCZ.backup_brief) - async def backup(self, inter: disnake.ApplicationCommandInteraction): - """ - Create backup from current config. Backup filename will contain current date. - """ - date = datetime.today() - backup_path = self.config_dir.joinpath(f"config_backup_{date}.toml") - with open(backup_path, "w+", encoding="utf-8") as fd: - toml.dump(self.config.toml_dict, fd) - await inter.send(MessagesCZ.backup_created) - @config_cmd.sub_command(description=MessagesCZ.sync_template_brief) async def update(self, inter: disnake.ApplicationCommandInteraction): template_path = self.config_dir.joinpath("config.template.toml") diff --git a/cogs/dynamicconfig/messages_cz.py b/cogs/dynamicconfig/messages_cz.py index 567b14df1..7f9045dcf 100644 --- a/cogs/dynamicconfig/messages_cz.py +++ b/cogs/dynamicconfig/messages_cz.py @@ -7,11 +7,9 @@ class MessagesCZ(GlobalMessages): load_brief = "Znovu načte třídu ze souboru. Pro aplikování změn je potřeba znovu načíst i cog" list_brief = "Vypíše klíče konfigurace" get_brief = "Získá hodnotu z konfigurace" - backup_brief = "Vytvoří záložní kopii konfigurace v novém souboru. Záloha bude obsahovat dnešní datum" sync_template_brief = "Přidá nové klíče z template do konfigurace" wrong_key = "Nesprávný klíč" wrong_type = "Nesprávný typ" - backup_created = "Záloha konfigurace vytvořena." list_invalid_regex = "Chybný regex\n`{regex_err}`" config_updated = "Konfigurace aktualizována." config_loaded = "Konfigurace načtena."