Add files via upload
This commit is contained in:
parent
be7f0a0f9f
commit
cdf5ff2f3a
1 changed files with 26 additions and 0 deletions
26
database bot.py
Normal file
26
database bot.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
from time import sleep
|
||||
import os
|
||||
import datetime
|
||||
import wget
|
||||
from zipfile import ZipFile
|
||||
import shutil
|
||||
|
||||
|
||||
client = commands.Bot(command_prefix='.')
|
||||
|
||||
|
||||
@client.command()
|
||||
async def save(ctx):
|
||||
await ctx.message.attachments[0].save("newcharacter.zip")
|
||||
|
||||
await ctx.send("adding to database please wait")
|
||||
zf = ZipFile('newcharacter.zip', 'r')
|
||||
zf.extractall('a')
|
||||
zf.extractall('b')
|
||||
zf.close()
|
||||
shutil.make_archive('a/test', 'zip', 'a')
|
||||
await ctx.send("added to database")
|
||||
|
||||
client.run('NzUyMjUxMDU4OTA2MjAyMTQy.X1U6ZA.cIkHHcZIqAm-Xg3W_3DlOcTuvSA')
|
Reference in a new issue