removed save_image function
This commit is contained in:
parent
808013b29f
commit
592a2162cd
1 changed files with 0 additions and 29 deletions
|
|
@ -49,35 +49,6 @@ intents.message_content = True
|
||||||
bot = commands.Bot(command_prefix='!', intents=intents)
|
bot = commands.Bot(command_prefix='!', intents=intents)
|
||||||
#discord stuff END
|
#discord stuff END
|
||||||
|
|
||||||
#delete save_image function once it has been used. this is temporary
|
|
||||||
@bot.command()
|
|
||||||
async def save_image(ctx):
|
|
||||||
try:
|
|
||||||
if ctx.message.content.startswith("!describe "):
|
|
||||||
file_url = ctx.message.content.split(" ", maxsplit=1)[1]
|
|
||||||
elif ctx.message.attachments:
|
|
||||||
file_url = ctx.message.attachments[0].url
|
|
||||||
else:
|
|
||||||
print("No image linked or attached.")
|
|
||||||
return
|
|
||||||
except Exception as error:
|
|
||||||
await handle_error(error)
|
|
||||||
print("Couldn't find image.")
|
|
||||||
return
|
|
||||||
|
|
||||||
r = requests.get(file_url, stream=True)
|
|
||||||
|
|
||||||
imageName = "blank_image.png"
|
|
||||||
|
|
||||||
with open(imageName, 'wb') as out_file:
|
|
||||||
print(f"Saving image: {imageName}")
|
|
||||||
shutil.copyfileobj(r.raw, out_file)
|
|
||||||
|
|
||||||
if os.path.exists(imageName):
|
|
||||||
await ctx.send("Saved Image!")
|
|
||||||
else:
|
|
||||||
await ctx.send("Something went wrong.")
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def moderate(ctx, filename):
|
async def moderate(ctx, filename):
|
||||||
await ctx.send("Reminder, this currently tool works by replacing the filename on the ftp server with a black image. The description will remain the same and may need to be altered.")
|
await ctx.send("Reminder, this currently tool works by replacing the filename on the ftp server with a black image. The description will remain the same and may need to be altered.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue