backing up mainbank
This commit is contained in:
parent
5383bbfd4d
commit
5fb3f5798f
@ -4,6 +4,8 @@ from discord.ext import commands
|
||||
|
||||
import json
|
||||
import os
|
||||
import datetime
|
||||
import shutil
|
||||
|
||||
os.chdir("/opt/disbot")
|
||||
|
||||
@ -11,12 +13,12 @@ intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
|
||||
bot = commands.Bot(command_prefix='$', intents=intents)
|
||||
|
||||
|
||||
date = datetime.datetime.now()
|
||||
|
||||
@bot.event
|
||||
# Start succes indicator
|
||||
async def on_ready():
|
||||
shutil.copy("./mainbank.json", f"backup/{date.year}-{date.month}-{date.day-1}.json")
|
||||
print(f'We have logged in as {bot.user}')
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user