test inspire
This commit is contained in:
+10
-4
@@ -245,6 +245,13 @@ class Shitpost(commands.Cog):
|
||||
if 'nee' in answer:
|
||||
reactie += 'Nee helaas..'
|
||||
yield from ctx.channel.send(ctx.author.mention + ' ' + reactie)
|
||||
|
||||
def get_inspiration(self):
|
||||
inspiration = requests.get(url='http://inspirobot.me/api?generate=true')
|
||||
if inspiration:
|
||||
return inspiration.text
|
||||
return None
|
||||
|
||||
|
||||
@commands.command(pass_context=True, hidden=False)
|
||||
@asyncio.coroutine
|
||||
@@ -253,11 +260,10 @@ class Shitpost(commands.Cog):
|
||||
Bijvoorbeeld:
|
||||
!inspire
|
||||
"""
|
||||
r = requests.get(url='http://inspirobot.me/api?generate=true')
|
||||
if r.status_code == 200:
|
||||
url = r.text
|
||||
inspo = self.get_inspiration()
|
||||
if inspo:
|
||||
em = discord.Embed(title='Uw wijze woorden:', type='photo')
|
||||
em.set_image(url=url)
|
||||
em.set_image(url=inspo)
|
||||
try:
|
||||
yield from ctx.message.delete()
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user