changed backup logic

pull/40/head
Who? 2024-12-17 23:07:32 +07:00 committed by GitHub
parent 884682f5ca
commit ed981a7bfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 6 deletions

View File

@ -125,7 +125,7 @@ class HikkaBackupMod(loader.Module):
backup = io.BytesIO(json.dumps(self._db).encode()) backup = io.BytesIO(json.dumps(self._db).encode())
backup.name = ( backup.name = (
f"hikka-db-backup-{datetime.datetime.now():%d-%m-%Y-%H-%M}.json" f"heroku-db-backup-{datetime.datetime.now():%d-%m-%Y-%H-%M}.json"
) )
await self.inline.bot.send_document( await self.inline.bot.send_document(
@ -136,7 +136,7 @@ class HikkaBackupMod(loader.Module):
[ [
{ {
"text": "↪️ Restore this", "text": "↪️ Restore this",
"data": "hikka/backup/restore/confirm", "data": "heroku/backup/restore/confirm",
} }
] ]
] ]
@ -147,21 +147,21 @@ class HikkaBackupMod(loader.Module):
except loader.StopLoop: except loader.StopLoop:
raise raise
except Exception: except Exception:
logger.exception("HikkaBackup failed") logger.exception("HerokuBackup failed")
await asyncio.sleep(60) await asyncio.sleep(60)
@loader.callback_handler() @loader.callback_handler()
async def restore(self, call: BotInlineCall): async def restore(self, call: BotInlineCall):
if not call.data.startswith("hikka/backup/restore"): if not call.data.startswith("heroku/backup/restore"):
return return
if call.data == "hikka/backup/restore/confirm": if call.data == "heroku/backup/restore/confirm":
await utils.answer( await utils.answer(
call, call,
"❓ <b>Are you sure?</b>", "❓ <b>Are you sure?</b>",
reply_markup={ reply_markup={
"text": "✅ Yes", "text": "✅ Yes",
"data": "hikka/backup/restore", "data": "heroku/backup/restore",
}, },
) )
return return