Exemple #1
0
 async def quote(self, ctx):
     async with ctx.message.channel.typing():
         data = myself.insp(
             'https://quotes.herokuapp.com/libraries/math/random')
         text, quoter = data.split(' -- ')[0], data.split(' -- ')[1]
         await ctx.send(embed=discord.Embed(
             description=f'***{text}***\n\n-- {quoter} --',
             color=discord.Colour.from_rgb(201, 160, 112)))
Exemple #2
0
 async def newemote(self, ctx):
     data = myself.insp('https://discordemoji.com/')
     byEmote = data.split('<div class="float-right"><a href="')
     del byEmote[0]
     alls = []
     for i in range(0, len(byEmote)):
         if byEmote[i].startswith('http'):
             alls.append(byEmote[i].split('"')[0])
     embed = discord.Embed(colour=discord.Colour.from_rgb(201, 160, 112))
     embed.set_image(url=random.choice(alls))
     await ctx.send(embed=embed)
Exemple #3
0
 async def ascii(self, ctx, *args):
     text = myself.urlify(' '.join(
         list(args))) if len(list(args)) > 0 else 'ascii%20text'
     try:
         await ctx.send('```{}```'.format(
             myself.insp(
                 'http://artii.herokuapp.com/make?text={}'.format(text))))
     except:
         await ctx.send(
             '{} | Your text is too long to be processed!'.format(
                 self.client.get_emoji(BotEmotes.error)))
Exemple #4
0
 async def catfact(self, ctx):
     if 'cat' in str(ctx.message.content).lower():
         await ctx.send(
             '**Did you know?**\n' +
             str(myself.jsonisp("https://catfact.ninja/fact")['fact']))
     elif 'dog' in str(ctx.message.content).lower():
         await ctx.send('**Did you know?**\n' + str(
             myself.jsonisp("https://dog-api.kinduff.com/api/facts")
             ['facts'][0]))
     else:
         wait = await ctx.send(
             str(self.client.get_emoji(BotEmotes.loading)) +
             ' | Please wait...')
         data = myself.insp('https://bestlifeonline.com/random-fun-facts/')
         byFact = data.split('<div class="title ">')
         accepted, facts = False, []
         for a in byFact:
             if a.split('</div')[0].startswith('Superman'): accepted = True
             if accepted:
                 facts.append(a.split('</div>')[0])
             else:
                 continue
         await wait.edit(content='**Did you know?**\n' +
                         str(random.choice(facts)))
Exemple #5
0
 async def inspirobot(self, ctx):
     async with ctx.message.channel.typing():
         img = myself.insp('https://inspirobot.me/api?generate=true')
         await ctx.send(
             file=discord.File(Painter.urltoimage(img), 'inspirobot.png'))