Exemple #1
0
 async def gdcomment(self, ctx, *args):
     async with ctx.message.channel.typing():
         try:
             byI = str(' '.join(list(args))).split(' | ')
             text = myself.urlify(byI[0])
             num = int(byI[2])
             if num > 9999: num = 601
             elif num < -9999: num = -601
             gdprof = myself.urlify(byI[1])
             if ctx.message.author.guild_permissions.manage_guild:
                 url = 'https://gdcolon.com/tools/gdcomment/img/' + str(
                     text) + '?name=' + str(gdprof) + '&likes=' + str(
                         num) + '&mod=mod&days=1-second'
             else:
                 url = 'https://gdcolon.com/tools/gdcomment/img/' + str(
                     text) + '?name=' + str(gdprof) + '&likes=' + str(
                         num) + '&days=1-second'
             await ctx.send(
                 file=discord.File(Painter.urltoimage(url), 'gdcomment.png')
             )
         except Exception as e:
             await ctx.send(
                 str(self.client.get_emoji(BotEmotes.error)) +
                 f' | Invalid!\nThe flow is this: `{Config.prefix}gdcomment text | name | like count`\nExample: `{prefix}gdcomment I am cool | RobTop | 601`.\n\nFor developers: ```{e}```'
             )
Exemple #2
0
 async def barcode(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.error)) +
             ' | Please provide a text!')
     else:
         async with ctx.message.channel.typing():
             if 'qr' in str(ctx.message.content).split(' ')[0][1:]:
                 url = "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=" + str(
                     myself.urlify(str(' '.join(list(args)))))
             else:
                 url = 'http://www.barcode-generator.org/zint/api.php?bc_number=20&bc_data=' + str(
                     myself.urlify(str(' '.join(list(args)))))
             await ctx.send(file=discord.File(Painter.urltoimage(url),
                                              'qr_or_barcode.png'))
Exemple #3
0
 async def drake(self, ctx, *args):
     unprefixed = str(ctx.message.content).split('drake ')[1]
     if list(args)[0]=='help':
         embed = discord.Embed(
             title='Drake meme helper help',
             description='Type the following:\n`'+str(Config.prefix)+'drake [text1] [text2]`\n\nFor example:\n`'+str(Config.prefix)+'drake [test1] [test2]`'
         )
         await ctx.send(embed=embed)
     else:
         async with ctx.message.channel.typing():
             txt1 = myself.urlify(unprefixed.split('[')[1][:-2])
             txt2 = myself.urlify(unprefixed.split('[')[2][:-1])
             url='https://api.alexflipnote.dev/drake?top='+str(txt1)+'&bottom='+str(txt2)
             data = Painter.urltoimage(url)
             await ctx.send(file=discord.File(data, 'drake.png'))
Exemple #4
0
 async def gdbox(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.error)) +
             ' | Please input a text!')
     else:
         async with ctx.message.channel.typing():
             text, av = myself.urlify(str(' '.join(
                 list(args)))), ctx.message.author.avatar_url
             if len(text) > 100:
                 await ctx.send(
                     str(self.client.get_emoji(BotEmotes.error)) +
                     ' | the text is too long!')
             else:
                 if not ctx.message.author.guild_permissions.manage_guild:
                     color = 'brown'
                 else:
                     color = 'blue'
                 url = 'https://gdcolon.com/tools/gdtextbox/img/' + str(
                     text) + '?color=' + color + '&name=' + str(
                         ctx.message.author.name) + '&url=' + str(
                             av).replace('webp', 'png') + '&resize=1'
                 await ctx.send(
                     file=discord.File(Painter.urltoimage(url), 'gdbox.png')
                 )
Exemple #5
0
 async def recipe(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             embed=discord.Embed(title='Here is a recipe to cook nothing:',
                                 description='1. Do nothing\n2. Profit'))
     else:
         data = myself.jsonisp(
             "http://www.recipepuppy.com/api/?q={}".format(
                 myself.urlify(' '.join(list(args)))))
         if len(data['results']) == 0:
             await ctx.send("{} | Did not find anything.".format(
                 str(self.client.get_emoji(BotEmotes.error))))
         elif len([i for i in data['results']
                   if i['thumbnail'] != '']) == 0:
             await ctx.send(
                 "{} | Did not find anything with a delicious picture.".
                 format(str(self.client.get_emoji(BotEmotes.error))))
         else:
             total = random.choice(
                 [i for i in data['results'] if i['thumbnail'] != ''])
             embed = discord.Embed(title=total['title'],
                                   url=total['href'],
                                   description='Ingredients:\n{}'.format(
                                       total['ingredients']),
                                   color=discord.Colour.from_rgb(
                                       201, 160, 112))
             embed.set_image(url=total['thumbnail'])
             await ctx.send(embed=embed)
Exemple #6
0
 async def itunes(self, ctx, *args):
     if len(list(args)) == 0:
         return await ctx.send('{} | Please send a search term!'.format(
             str(self.client.get_emoji(BotEmotes.error))))
     data = myself.jsonisp(
         'https://itunes.apple.com/search?term={}&media=music&entity=song&limit=1&explicit=no'
         .format(myself.urlify(' '.join(list(args)))))
     if len(data['results']) == 0:
         return await ctx.send('{} | No music found... oop'.format(
             self.client.get_emoji(BotEmotes.error)))
     data = data['results'][0]
     em = discord.Embed(
         title=data['trackName'],
         url=data['trackViewUrl'],
         description=
         '**Artist: **{}\n**Album: **{}\n**Release Date:** {}\n**Genre: **{}'
         .format(data['artistName'], data['collectionName'],
                 data['releaseDate'].replace('T', ' ').replace('Z', ''),
                 data['primaryGenreName']),
         color=discord.Color.from_rgb(201, 160, 112))
     em.set_thumbnail(url=data['artworkUrl100'])
     em.set_author(name='iTunes',
                   icon_url='https://i.imgur.com/PR29ow0.jpg',
                   url='https://www.apple.com/itunes/')
     await ctx.send(embed=em)
Exemple #7
0
 def serverstats(self, guild):
     start = "https://quickchart.io/chart?c="
     data1 = [
         str(
             len([
                 i for i in guild.members
                 if i.status.value.lower() == 'online'
             ])),
         str(
             len([
                 i for i in guild.members
                 if i.status.value.lower() == 'idle'
             ])),
         str(
             len([
                 i for i in guild.members if i.status.value.lower() == 'dnd'
             ])),
         str(
             len([
                 i for i in guild.members
                 if i.status.value.lower() == 'offline'
             ]))
     ]
     img1 = "{type:'pie',data:{labels:['Online', 'Idle', 'Do not Disturb', 'Offline'], datasets:[{data:[" + data1[
         0] + ", " + data1[1] + ", " + data1[2] + ", " + data1[3] + "]}]}}"
     img = self.imagefromURL(start + myself.urlify(img1))
     w, h = img.size
     cnv = Image.new(mode='RGB', size=(w, h), color=(255, 255, 255))
     cnv.paste(img, (0, 0), img)
     return self.buffer(cnv)
Exemple #8
0
 async def trap(self, ctx):
     if len(ctx.message.mentions)==0:
         await ctx.send(str(self.client.get_emoji(BotEmotes.error)) +f' | Wrong.\nPlease try the correct like following:\n`{prefix}trap [tag]`')
     else:
         async with ctx.message.channel.typing():
             url='http://nekobot.xyz/api/imagegen?type=trap&name='+myself.urlify(str(ctx.message.mentions[0].name))+'&author='+myself.urlify(str(message.author.name))+'&image='+str(message.mentions[0].avatar_url).replace('.webp?size=1024', '.png')+'&raw=1'
             await ctx.send(file=discord.File(Painter.urltoimage(url), 'trap.png'))
Exemple #9
0
 async def morse(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.error)) +
             ' | no arguments? Really?')
     elif len(' '.join(list(args))) > 100:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.error)) +
             ' | too long....')
     else:
         async with ctx.message.channel.typing():
             res = myself.jsonisp(
                 'https://useless-api--vierofernando.repl.co/encode?text=' +
                 myself.urlify(' '.join(list(args))))
             if 'fliptext' in str(ctx.message.content).split(' ')[0][1:]:
                 data = res['styles']['upside-down']
             elif 'cursive' in str(ctx.message.content).split(' ')[0][1:]:
                 data = res['styles']['cursive']
             elif 'fancy' in str(ctx.message.content).split(' ')[0][1:]:
                 data = res['styles']['fancy']
             elif 'braille' in str(ctx.message.content).split(' ')[0][1:]:
                 data = res['braille']
             else:
                 data = res['ciphers']['morse']
             await ctx.send(f'{data}')
Exemple #10
0
 async def rhyme(self, ctx, *args):
     if len(list(args)) == 0:
         await message.channel.send(
             'Please input a word! And we will try to find the word that best rhymes with it.'
         )
     else:
         wait, words = await ctx.send(
             str(self.client.get_emoji(BotEmotes.loading)) +
             ' | Please wait... Searching...'), []
         data = myself.api(
             'https://rhymebrain.com/talk?function=getRhymes&word=' +
             str(myself.urlify(' '.join(list(args)))))
         if len(data) < 1:
             await wait.edit(
                 content=
                 'We did not find any rhyming words corresponding to that letter.'
             )
         else:
             for i in range(0, len(data)):
                 if data[i]['flags'] == 'bc': words.append(data[i]['word'])
             words = myself.dearray(words)
             if len(words) > 1950:
                 words = myself.limitify(words)
             embed = discord.Embed(title='Words that rhymes with ' +
                                   str(' '.join(list(args))) + ':',
                                   description=words,
                                   colour=discord.Colour.from_rgb(
                                       201, 160, 112))
             await wait.edit(content='', embed=embed)
Exemple #11
0
 async def gdsearch(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.error)) +
             ' | Please input a query!')
     else:
         try:
             query = myself.urlify(' '.join(list(args)))
             data = myself.api('https://gdbrowser.com/api/search/' +
                               str(query))
             levels, count = '', 0
             for i in range(0, len(data)):
                 if data[count]['disliked']: like = ':-1:'
                 else: like = ':+1:'
                 levels += str(
                     count +
                     1) + '. **' + data[count]['name'] + '** by ' + data[
                         count]['author'] + ' (`' + data[count][
                             'id'] + '`)\n:arrow_down: ' + data[count][
                                 'downloads'] + ' | ' + like + ' ' + data[
                                     count]['likes'] + '\n'
                 count += 1
             embedy = discord.Embed(
                 title='Geometry Dash Level searches for "' +
                 str(' '.join(list(args))) + '":',
                 description=levels,
                 colour=discord.Colour.from_rgb(201, 160, 112))
             await ctx.send(embed=embedy)
         except:
             await ctx.send(
                 str(self.client.get_emoji(BotEmotes.error)) +
                 ' | Error: Not Found. :four::zero::four:')
Exemple #12
0
 async def robohash(self, ctx, *args):
     if len(list(args)) == 0:
         url = 'https://robohash.org/' + str(src.randomhash())
     else:
         url = 'https://robohash.org/' + str(
             myself.urlify(' '.join(list(args))))
     await ctx.send(
         file=discord.File(Painter.urltoimage(url), 'robohash.png'))
Exemple #13
0
 async def scroll(self, ctx, *args):
     if len(list(args))==0: await ctx.send(str(self.client.get_emoji(BotEmotes.error))+" | Error! where is your text?")
     else:
         async with ctx.message.channel.typing():
             scrolltxt = myself.urlify(' '.join(list(args)))
             embed = discord.Embed(colour=discord.Colour.from_rgb(201, 160, 112))
             url='https://api.alexflipnote.dev/scroll?text='+str(scrolltxt)
             data = Painter.urltoimage(url)
             await ctx.send(file=discord.File(data, 'scroll.png'))
Exemple #14
0
 async def nasa(self, ctx, *args):
     query = 'earth' if len(list(args))==0 else myself.urlify(' '.join(list(args)))
     data = myself.jsonisp(f'https://images-api.nasa.gov/search?q={query}&media_type=image')
     await ctx.message.channel.trigger_typing()
     if len(data['collection']['items'])==0: return await ctx.send('{} | Nothing found.'.format(self.client.get_emoji(BotEmotes.error)))
     img = random.choice(data['collection']['items'])
     em = discord.Embed(title=img['data'][0]['title'], description=img['data'][0]["description"], color=discord.Colour.from_rgb(201, 160, 112))
     em.set_image(url=img['links'][0]['href'])
     await ctx.send(embed=em)
Exemple #15
0
 async def didyoumean(self, ctx, *args):
     if args[1]=='help':
         embed = discord.Embed(title='didyoumean command help', description='Type like the following\n'+prefix+'didyoumean [text1] [text2]\n\nFor example:\n'+prefix+'didyoumean [i am gay] [i am guy]', colour=discord.Colour.from_rgb(201, 160, 112))
         await message.channel.send(embed=embed)
     else:
         async with ctx.message.channel.typing():
             txt1, txt2 = myself.urlify(str(ctx.message.content).split('[')[1][:-2]), myself.urlify(str(ctx.message.content).split('[')[2][:-1])
             url='https://api.alexflipnote.dev/didyoumean?top='+str(txt1)+'&bottom='+str(txt2)
             await ctx.send(file=discord.File(Painter.urltoimage(url), 'didyoumean.png'))
Exemple #16
0
 async def challenge(self, ctx, *args):
     if len(list(args))==0: await ctx.send(str(self.client.get_emoji(BotEmotes.error))+' | What is the challenge?')
     else:
         async with ctx.message.channel.typing():
             txt = myself.urlify(' '.join(args))
             if 'challenge' in str(ctx.message.content).split(' ')[0][1:]: url='https://api.alexflipnote.dev/challenge?text='+str(txt)
             elif 'call' in str(ctx.message.content).split(' ')[0][1:]: url='https://api.alexflipnote.dev/calling?text='+str(txt)
             else: url='https://api.alexflipnote.dev/achievement?text='+str(txt)
             await ctx.send(file=discord.File(Painter.urltoimage(url), 'minecraft_notice.png'))
Exemple #17
0
 async def drake(self, ctx, *args):
     unprefixed = ' '.join(list(args))
     if list(args)[0]=='help' or len(list(args))==0:
         embed = discord.Embed(
             title='Drake meme helper help',
             description='Type the following:\n`'+str(Config.prefix)+'drake [text1] [text2]`\n\nFor example:\n`'+str(Config.prefix)+'drake [test1] [test2]`'
         )
         await ctx.send(embed=embed)
     else:
         try:
             async with ctx.message.channel.typing():
                 txt1 = myself.urlify(unprefixed.split('[')[1][:-2])
                 txt2 = myself.urlify(unprefixed.split('[')[2][:-1])
                 url='https://api.alexflipnote.dev/drake?top='+str(txt1)+'&bottom='+str(txt2)
                 data = Painter.urltoimage(url)
                 await ctx.send(file=discord.File(data, 'drake.png'))
         except IndexError:
             await ctx.send(str(self.client.get_emoji(BotEmotes.error))+" | Please send something like {}drake [test 1] [test2]!".format(Config.prefix))
Exemple #18
0
 async def steamprofile(self, ctx, *args):
     try:
         getprof = myself.urlify(list(args)[0].lower())
         data = myself.jsonisp('https://api.alexflipnote.dev/steam/user/'+str(getprof))
         state, privacy, url, username, avatar, custom_url, steam_id = data["state"], data["privacy"], data["url"], data["username"], data["avatarfull"], data["customurl"], data["steamid64"]
         embed = discord.Embed(title=username, description='**[Profile Link]('+str(url)+')**\n**Current state: **'+str(state)+'\n**Privacy: **'+str(privacy)+'\n**[Profile pic URL]('+str(avatar)+')**', colour = discord.Color.from_rgb(201, 160, 112))
         embed.set_thumbnail(url=avatar)
         await ctx.send(embed=embed)
     except:
         await ctx.send(str(self.client.get_emoji(BotEmotes.error))+" | Error; profile not found!")
Exemple #19
0
 async def weather(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.error)) +
             " | Please send a location or a city!")
     else:
         await ctx.send(file=discord.File(
             Painter.urltoimage('https://wttr.in/' +
                                str(myself.urlify(' '.join(list(args)))) +
                                '.png?m'), 'weather.png'))
Exemple #20
0
 async def gdlogo(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.error)) +
             ' | Please input a text!')
     else:
         async with ctx.message.channel.typing():
             text = myself.urlify(' '.join(list(args)))
             url = 'https://gdcolon.com/tools/gdlogo/img/' + str(text)
             await ctx.send(
                 file=discord.File(Painter.urltoimage(url), 'gdlogo.png'))
Exemple #21
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 #22
0
 async def didyoumean(self, ctx, *args):
     if list(args)[0]=='help' or len(list(args))==0:
         embed = discord.Embed(title='didyoumean command help', description='Type like the following\n'+prefix+'didyoumean [text1] [text2]\n\nFor example:\n'+prefix+'didyoumean [i am gay] [i am guy]', colour=discord.Colour.from_rgb(201, 160, 112))
         await ctx.send(embed=embed)
     else:
         try:
             async with ctx.message.channel.typing():
                 txt1, txt2 = myself.urlify(str(ctx.message.content).split('[')[1][:-2]), myself.urlify(str(ctx.message.content).split('[')[2][:-1])
                 url='https://api.alexflipnote.dev/didyoumean?top='+str(txt1)+'&bottom='+str(txt2)
                 await ctx.send(file=discord.File(Painter.urltoimage(url), 'didyoumean.png'))
         except IndexError:
             await ctx.send(str(self.client.get_emoji(BotEmotes.error))+' | error! invalid args!')
Exemple #23
0
 async def country(self, ctx, *args):
     country = myself.urlify(' '.join(list(args)))
     c = myself.api("https://restcountries.eu/rest/v2/name/"+str(country.lower()))
     if len(c[0]['borders'])==0: borderz = 'No borders.'
     else: borderz = myself.dearray(c[0]['borders'])
     embed = discord.Embed(
         title = c[0]['nativeName'],
         description = '**Capital:** '+str(c[0]['capital'])+'\n**Region: **'+str(c[0]['region'])+'\n**Sub Region: **'+str(c[0]['subregion'])+"\n**Population: **"+str(c[0]['population'])+"\n**Area: **"+str(c[0]['area'])+' km²\n**Time Zones:** '+str(myself.dearray(c[0]['timezones']))+'\n**Borders: **'+str(borderz),
         colour = discord.Colour.from_rgb(201, 160, 112)
     )
     embed.set_author(name=c[0]['name'])
     await ctx.send(embed=embed)
Exemple #24
0
 async def search(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.error)) +
             " | Please send something to search for......")
     else:
         data = loads(open("/app/assets/json/search.json", "r").read())
         await ctx.send(embed=discord.Embed(
             title='Internet searches for ' +
             str(' '.join(list(args)),
                 description=str('\n'.join(data)).replace(
                     '{QUERY}',
                     myself.urlify(' '.join(list(args))),
                     color=discord.Colour.from_rgb(201, 160, 112)))))
Exemple #25
0
 async def wonka(self, ctx, *args):
     if 'avmeme' in ctx.message.content:
         async with ctx.message.channel.typing():
             try:
                 av = ctx.message.mentions[0].avatar_url
                 mes = ctx.message.content[int(len(args[0])+len(args[1])+1):]
                 top = myself.urlify(str(ctx.message.content).split('[')[1].split(']')[0])
                 bott = myself.urlify(str(ctx.message.content).split('[')[2].split(']')[0])
                 name = 'custom'
                 extr = '?alt='+str(av).replace('webp', 'png')
                 url='https://memegen.link/'+str(name)+'/'+str(top)+'/'+str(bott)+'.jpg'+str(extr)
                 await ctx.send(file=discord.File(Painter.memegen(url), 'avmeme.png'))
             except Exception as e:
                 await ctx.send(str(self.client.get_emoji(BotEmotes.error)) +f' | Error!\n```{e}```Invalid parameters. Example: `{prefix}avmeme <tag someone> [top text] [bottom text]`')
     else:
         async with ctx.message.channel.typing():
             try:
                 top = myself.urlify(str(ctx.message.content).split('[')[1].split(']')[0])
                 bott = myself.urlify(str(ctx.message.content).split('[')[2].split(']')[0])
                 name = str(ctx.message.content).split(Config.prefix)[1].split(' ')[0]
                 url='https://memegen.link/'+str(name)+'/'+str(top)+'/'+str(bott)+'.jpg?watermark=none'
                 await ctx.send(file=discord.File(Painter.memegen(url), args[0][1:]+'.png'))
             except Exception as e:
                 await ctx.send(str(self.client.get_emoji(BotEmotes.error)) +f' | Error!\n```{e}```Invalid parameters.')
Exemple #26
0
 async def steamapp(self, ctx, *args):
     data = myself.jsonisp('https://store.steampowered.com/api/storesearch?term='+myself.urlify(str(' '.join(list(args))))+'&cc=us&l=en')
     if data['total']==0: await ctx.send(str(self.client.get_emoji(BotEmotes.error))+' | Did not found anything. Maybe that app *doesn\'t exist...*')
     else:
         try:
             prize = data['items'][0]['price']['initial']
             prize = str(prize / 100)+ ' ' + data['items'][0]['price']['currency']
         except KeyError: prize = 'FREE'
         if data['items'][0]['metascore']=="": rate = '???'
         else: rate = str(data['items'][0]['metascore'])
         oss_raw = []
         for i in range(0, len(data['items'][0]['platforms'])):
             if data['items'][0]['platforms'][str(list(data['items'][0]['platforms'].keys())[i])]==True:
                 oss_raw.append(str(list(data['items'][0]['platforms'].keys())[i]))
         embed = discord.Embed(title=data['items'][0]['name'], url='https://store.steampowered.com/'+str(data['items'][0]['type'])+'/'+str(data['items'][0]['id']), description='**Price tag:** '+str(prize)+'\n**Metascore: **'+str(rate)+'\n**This app supports the following OSs: **'+str(myself.dearray(oss_raw)), colour=discord.Colour.from_rgb(201, 160, 112))
         embed.set_image(url=data['items'][0]['tiny_image'])
         await ctx.send(embed=embed)
Exemple #27
0
 async def stackoverflow(self, ctx, *args):
     if len(list(args)) == 0:
         await ctx.send(
             str(self.client.get_emoji(BotEmotes.errorr)) +
             ' | Hey fellow developer, Try add a question!')
     else:
         try:
             query = myself.urlify(' '.join(list(args)))
             data = myself.jsonisp(
                 "https://api.stackexchange.com/2.2/search/advanced?q=" +
                 str(query) +
                 "&site=stackoverflow&page=1&answers=1&order=asc&sort=relevance"
             )
             leng = len(data['items'])
             ques = data['items'][0]
             tags = ''
             for i in range(0, len(ques['tags'])):
                 if i == len(ques['tags']) - 1:
                     tags += '[' + str(
                         ques['tags'][i]
                     ) + '](https://stackoverflow.com/questions/tagged/' + str(
                         ques['tags'][i]) + ')'
                     break
                 tags += '[' + str(
                     ques['tags'][i]
                 ) + '](https://stackoverflow.com/questions/tagged/' + str(
                     ques['tags'][i]) + ') | '
             embed = discord.Embed(
                 title=ques['title'],
                 description='**' + str(ques['view_count']) +
                 ' *desperate* developers looked into this post.**\n**TAGS:** '
                 + str(tags),
                 url=ques['link'],
                 colour=discord.Colour.from_rgb(201, 160, 112))
             embed.set_author(name=ques['owner']['display_name'],
                              url=ques['owner']['link'],
                              icon_url=ques['owner']['profile_image'])
             embed.set_footer(text='Shown 1 result out of ' + str(leng) +
                              ' results!')
             await ctx.send(embed=embed)
         except:
             await ctx.send(
                 str(self.client.get_emoji(BotEmotes.error)) +
                 ' | There was an error on searching! Please check your spelling :eyes:'
             )
Exemple #28
0
 async def tv(self, ctx, *args):
     if len(list(args)) == 0:
         return await ctx.send(
             '{} | please gimme args',
             format(str(self.client.get_emoji(BotEmotes.error))))
     query = myself.urlify(' '.join(list(args)))
     data = get(f'http://api.tvmaze.com/singlesearch/shows?q={query}')
     if data.status_code == 404:
         return await ctx.send('{} | Oops! did not found any movie.'.format(
             str(self.client.get_emoji(BotEmotes.error))))
     try:
         data = data.json()
         star = str(':star:' * round(data['rating']['average'])) if data[
             'rating']['average'] != None else 'No star rating provided.'
         em = discord.Embed(title=data['name'],
                            url=data['url'],
                            description=myself.html2discord(
                                data['summary']),
                            color=discord.Colour.from_rgb(201, 160, 112))
         em.add_field(name='General Information',
                      value='**Status: **' + data['status'] +
                      '\n**Premiered at: **' + data['premiered'] +
                      '\n**Type: **' + data['type'] + '\n**Language: **' +
                      data['language'] + '\n**Rating: **' +
                      str(data['rating']['average'] if
                          data['rating']['average'] != None else 'None') +
                      '\n' + star)
         em.add_field(name='TV Network',
                      value=data['network']['name'] + ' at ' +
                      data['network']['country']['name'] + ' (' +
                      data['network']['country']['timezone'] + ')')
         em.add_field(
             name='Genre',
             value=str(
                 myself.dearray(data['genres'])
                 if len(data['genres']) > 0 else 'no genre avaliable'))
         em.add_field(name='Schedule',
                      value=myself.dearray(data['schedule']['days']) +
                      ' at ' + data['schedule']['time'])
         em.set_image(url=data['image']['original'])
         await ctx.send(embed=em)
     except:
         await ctx.send('{} | Oops! There was an error...'.format(
             str(self.client.get_emoji(BotEmotes.error))))
Exemple #29
0
 async def uptime(self, ctx):
     up, cmds = selfDB.get_uptime(), username601Stats.retrieveData()
     imageurl = myself.urlify(myself.uptimerobot())
     bot_uptime = up.split('|')[0].split(':')[0] + ' Hours, ' + up.split(
         '|')[0].split(':')[1] + ' minutes, ' + up.split('|')[0].split(
             ':')[2] + ' seconds.'
     embed = discord.Embed(
         description=
         'Bot uptime: {}\nOS uptime: {}\nLast downtime: {} UTC\n\nCommands run in the past {}: {}'
         .format(
             bot_uptime,
             str(myself.terminal('uptime -p'))[3:],
             up.split('|')[1],
             myself.time_encode(
                 round(t.now().timestamp()) - round(cmds['lastreset'])),
             str(cmds['count'])),
         color=discord.Colour.from_rgb(201, 160, 112))
     embed.set_image(url='https://quickchart.io/chart?c=' + imageurl)
     await ctx.send(embed=embed)
Exemple #30
0
 async def pokeinfo(self, ctx, *args):
     query = 'Missingno' if (len(list(args))==0) else myself.urlify(' '.join(list(args)))
     try:
         data = myself.jsonisp('https://bulbapedia.bulbagarden.net/w/api.php?action=query&titles={}&format=json&formatversion=2&pithumbsize=150&prop=extracts|pageimages&explaintext&redirects&exintro'.format(query))
         embed = discord.Embed(
             url='https://bulbapedia.bulbagarden.net/wiki/{}'.format(query),
             color=discord.Colour.from_rgb(201, 160, 112),
             title=data['query']['pages'][0]['title'], description=myself.limitto(data['query']['pages'][0]['extract'], 1000)
         )
         try:
             pokeimg = data['query']['pages'][0]['thumbnail']['source']
             embed.set_thumbnail(url=pokeimg)
         except:
             pass
         await ctx.send(embed=embed)
     except Exception as e:
         print(e)
         return await ctx.send("{} | Pokemon not found!".format(
             str(self.client.get_emoji(BotEmotes.error))
         ))