Browse Source

disabled upload until that mess can be sorted.

tags/v1.7.0
Roxie Gibson 6 years ago
parent
commit
e32fbb3d6e
3 changed files with 13 additions and 12 deletions
  1. +7
    -2
      README.md
  2. +6
    -8
      Roxbot/cogs/util.py
  3. +0
    -2
      requirements.txt

+ 7
- 2
README.md View File

@@ -18,10 +18,15 @@ _Coming Soon_
#### v1.7.0
###### New Features
- NSFW commands now have the same system of preventing dupe outputs
###### Minor Changes

###### Misc. Changes
- `avatar` now outputs a png if the image is static.
- Moved NSFW commands to use aiohttp instead of requests which hopefully will wield quicker response times.
- EmbedColours are now standardised within RoxBot.
- All of RoxBot's requests are now handled by the http file. All http requests have been moved to aiohttp.
- requests and lxml have been removed as dependencies of Roxbot.
- `upload` has been disabled for the time being until a way for it to work with aiohttp is found.
- Minor refactoring in places, which involves some directory movement.

###### Bug Fixes
- Doubled the amount of times subreddit commands will cycle through possible requests to fix JSON decode error.
- Fixed error in reddit cog due to changing JSON outputs thanks to new reddit redesign.

+ 6
- 8
Roxbot/cogs/util.py View File

@@ -1,7 +1,5 @@
import os
import random
import discord
import requests
from discord.ext import commands
from discord.ext.commands import bot

@@ -136,7 +134,7 @@ class Util():
embed.add_field(name="Managed", value=str(role.managed), inline=False)
return await ctx.send(embed=embed)

@bot.command(enabled=True)
@bot.command(enabled=False)
async def upload(self, ctx):
"""
Uploads selected file to the host, thanks to the fact that
@@ -152,7 +150,7 @@ class Util():
"https://vidga.me/",
"https://pomf.pyonpyon.moe/"
] # List of pomf clone sites and upload limits
if ctx.message.attachments:
"""if ctx.message.attachments:
# Site choice, shouldn't need an upload size check since max upload for discord atm is 50MB
site = random.choice(sites)
urls = []
@@ -163,16 +161,16 @@ class Util():
# Download File
await Roxbot.http.download_file(attachment.url, name)
# Upload file
with open(name, 'rb') as f:
answer = requests.post(url=site + "upload.php", files={'files[]': (name, f.read())})
response = answer.json()
#with open(name, 'rb') as f:
# answer = requests.post(url=site + "upload.php", files={'files[]': (name, f.read())})
#response = answer.json()
file_name_1 = response["files"][0]["url"].replace("\\", "")
urls.append(file_name_1)
os.remove(name)
msg = "".join(urls)
return await ctx.send(msg)
else:
return await ctx.send("Send me stuff to upload.")
return await ctx.send("Send me stuff to upload.")"""

@upload.error
async def upload_err(self, ctx, error):

+ 0
- 2
requirements.txt View File

@@ -1,5 +1,3 @@
requests==2.18.4
lxml==3.8.0
aiohttp==3.0.1
beautifulsoup4==4.6.0
discord==0.0.2

Loading…
Cancel
Save