Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cogs/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

BACKUP_TIME = dtime(hour=4, tzinfo=TIMEZONE)
MAX_FILE_BYTES = 10 * 1024 * 1024 # limite d'un fichier envoyé par webhook
WEBHOOK_NAME = "BotDiff Sauvegardes"


@dataclass(frozen=True)
Expand Down Expand Up @@ -128,7 +127,6 @@ async def send_backup(self, reason: str) -> bool:
await webhook.send(
backup_message(backup, reason),
file=discord.File(io.BytesIO(backup.data), filename=backup.filename),
username=WEBHOOK_NAME,
allowed_mentions=discord.AllowedMentions.none(),
)
except (discord.HTTPException, ValueError) as exc:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def test_envoi_dans_le_salon(tracked_bot, webhook) -> None:
assert webhook.urls == [WEBHOOK]
assert sent["content"].startswith("💾 **Sauvegarde quotidienne** · 2 joueur(s) suivi(s) sur 1 serveur(s)")
assert sent["file"].filename.endswith(".db.gz")
assert sent["username"] == "BotDiff Sauvegardes"
assert "username" not in sent # nom et avatar : ceux du webhook, réglés dans Discord


async def test_une_seule_sauvegarde_au_demarrage(tracked_bot, webhook) -> None:
Expand Down