🐛 Change the way defer works, so it's all done by the bot instance
This commit is contained in:
@ -13,7 +13,7 @@ class BedreNetflix():
|
||||
|
||||
#Returns a list of no more than 5 options when user requests a movie
|
||||
async def requestMovie(self, ctx, movieName):
|
||||
await ctx.defer()
|
||||
await self.bot.defer(ctx)
|
||||
|
||||
self.bot.log("Searching for "+movieName)
|
||||
movieList = imdb.IMDb().search_movie(movieName)
|
||||
@ -92,7 +92,7 @@ class BedreNetflix():
|
||||
|
||||
#Returns a list of no more than 5 options when user requests a show
|
||||
async def requestShow(self, ctx, showName):
|
||||
await ctx.defer()
|
||||
await self.bot.defer(ctx)
|
||||
|
||||
self.bot.log("Searching for "+showName)
|
||||
movies = imdb.IMDb().search_movie(showName) #Replace with tvdb
|
||||
@ -307,7 +307,7 @@ class BedreNetflix():
|
||||
await ctx.send("```"+messageText[:cutOffIndex]+"```")
|
||||
await SendLongMessage(ctx,messageText[cutOffIndex+1:])
|
||||
|
||||
await ctx.defer()
|
||||
await self.bot.defer(ctx)
|
||||
|
||||
# showDM, showMovies, showShows, episodes
|
||||
params = [False, False, False, False]
|
||||
|
@ -1,4 +1,4 @@
|
||||
import discord, wolframalpha, requests, os
|
||||
import discord, discord_slash, wolframalpha, requests, os
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
class NerdShit():
|
||||
@ -7,8 +7,8 @@ class NerdShit():
|
||||
self.bot = bot
|
||||
|
||||
async def wolfSearch(self,ctx,content):
|
||||
await self.bot.defer(ctx)
|
||||
fnt = ImageFont.truetype('resources/fonts/times-new-roman.ttf', 20)
|
||||
await ctx.defer()
|
||||
self.bot.log("Requesting data")
|
||||
bot = wolframalpha.Client(self.bot.credentials.wolfKey)
|
||||
res = bot.query(content)
|
||||
@ -36,19 +36,19 @@ class NerdShit():
|
||||
heights = []
|
||||
for count, pod in enumerate(chunk):
|
||||
heights += [height]
|
||||
width = max(width,int(list(pod.img)[0]["@width"]))
|
||||
width = max(width,int(pod.img['@width']))
|
||||
if titleChucks[x][count] == "":
|
||||
placeForText = 0
|
||||
else:
|
||||
placeForText = 30
|
||||
height += int(list(pod.img)[0]["@height"]) + 10 + placeForText
|
||||
height += int(pod.img["@height"]) + 10 + placeForText
|
||||
|
||||
width += 10
|
||||
height += 5
|
||||
wolfImage = Image.new("RGB",(width,height),color=(255,255,255))
|
||||
|
||||
for count, pod in enumerate(chunk):
|
||||
response = requests.get(list(pod.img)[0]["@src"])
|
||||
response = requests.get(pod.img["@src"])
|
||||
file = open("resources/wolfTemp.png", "wb")
|
||||
file.write(response.content)
|
||||
file.close()
|
||||
|
@ -34,7 +34,7 @@ class Other():
|
||||
|
||||
# Picks a random movie and returns information about it
|
||||
async def movieFunc(self, ctx):
|
||||
await ctx.defer()
|
||||
await self.bot.defer(ctx)
|
||||
|
||||
self.bot.log("Creating IMDb object")
|
||||
imdbClient = imdb.IMDb()
|
||||
@ -138,7 +138,7 @@ class Other():
|
||||
|
||||
# Finds a page from the Senkulpa Wikia
|
||||
async def findWikiPage(self, ctx, search : str):
|
||||
await ctx.defer()
|
||||
await self.bot.defer(ctx)
|
||||
foundPage = False
|
||||
|
||||
if search != "":
|
||||
|
Reference in New Issue
Block a user