Esempio n. 1
0
	async def auto_backups(self):
		await self.bot.wait_until_ready()
		raw_settings = guild_settings._open_config()
		while not self.bot.is_closed():
			if raw_settings != guild_settings._open_config():
				raw_settings = guild_settings._open_config()
				time = datetime.datetime.now()
				guild_settings.backup(raw_settings, "{:%Y.%m.%d %H:%M:%S} Auto Backup".format(time))
			await asyncio.sleep(300)
Esempio n. 2
0
 async def backup(self, ctx):
     time = datetime.datetime.now()
     filename = "{:%Y.%m.%d %H:%M:%S} Manual Backup".format(time)
     guild_settings.backup(guild_settings._open_config(), filename)
     return await ctx.send(
         "Settings file backed up as '{}.json'".format(filename))