Skip to content

Commit

Permalink
remove backup config command
Browse files Browse the repository at this point in the history
  • Loading branch information
solumath committed Jul 26, 2024
1 parent cd403ef commit 834b5cc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
12 changes: 0 additions & 12 deletions cogs/dynamicconfig/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import re
import shlex
from datetime import datetime
from typing import Any

import disnake
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 0 additions & 2 deletions cogs/dynamicconfig/messages_cz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."

0 comments on commit 834b5cc

Please sign in to comment.