diff --git a/.env.example b/.env.example index 048d2f8..b4373e0 100644 --- a/.env.example +++ b/.env.example @@ -4,4 +4,5 @@ SERVER_ID=yugytt457b SAVE_DIR=/dir DISCORD_WEBHOOK=https://webhookaddress MAIN_DOMAIN=http://baseOfDomainForbackupsPropagationViaWebhook +DISCORD_BACKUPNAME=ServerName DISCORD_ENABLED=1 \ No newline at end of file diff --git a/src/conf.py b/src/conf.py index 40135e1..3c9a973 100644 --- a/src/conf.py +++ b/src/conf.py @@ -10,6 +10,7 @@ class Config(BaseSettings): discord_webhook: str main_domain: str discord_enabled: int + disscord_backupname: str cfg = Config() diff --git a/src/discordPoster.py b/src/discordPoster.py index 84ded50..6c54229 100644 --- a/src/discordPoster.py +++ b/src/discordPoster.py @@ -1,6 +1,6 @@ import discordwebhook, datetime -def send_url_to_discord(webhook_url: str, backup_url: str, datetime: datetime.datetime): +def send_url_to_discord(webhook_url: str, backup_url: str, datetime: datetime.datetime, backup_name: str): webhook = discordwebhook.Webhook(url=webhook_url) - embed = discordwebhook.Embed(title=f"Backup of {datetime.year}-{datetime.month}-{datetime.day}", description=backup_url) + embed = discordwebhook.Embed(title=f"Backup of {backup_name} from {datetime.year}-{datetime.month}-{datetime.day}", description=backup_url) webhook.send_sync(content="", embed=embed) \ No newline at end of file