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'))
async def _8ball(self, ctx): async with ctx.message.channel.typing(): data = myself.api("https://yesno.wtf/api") if data["image"].endswith('.gif'): img, filename = Painter.gif.giffromURL(data["image"], True), 'answer.gif' else: img, filename = Painter.urltoimage(data["image"]), 'answer.png' await ctx.send(content=data['answer'], file=discord.File(img, filename))
async def changemymind(self, ctx, *args): if len(list(args))==0: await ctx.send(str(self.client.get_emoji(BotEmotes.error))+" | Error! You need a text...") else: await ctx.message.add_reaction(self.client.get_emoji(BotEmotes.loading)) async with ctx.message.channel.typing(): try: data = Painter.urltoimage('https://nekobot.xyz/api/imagegen?type=changemymind&text='+myself.urlify(' '.join(list(args)))+'&raw=1') await ctx.send(file=discord.File(data, 'changemymind.png')) except Exception as e: await ctx.send(str(self.client.get_emoji(BotEmotes.error))+" | Oops! There was an error on generating your meme; `"+str(e)+"`")
async def floor(self, ctx, *args): if len(list(args))==0: text = 'I forgot to put the arguments, oops' else: text = str(' '.join(args)) auth = str(ctx.message.author.avatar_url).replace('.gif', '.webp').replace('.webp', '.png') async with ctx.message.channel.typing(): if len(ctx.message.mentions)>0: auth = str(ctx.message.mentions[0].avatar_url).replace('.gif', '.webp').replace('.webp', '.png') if len(args)>2: text = str(ctx.message.content).split('> ')[1] else: text = 'I forgot to put the arguments, oops' await ctx.send(file=discord.File(Painter.urltoimage('https://api.alexflipnote.dev/floor?image='+auth+'&text='+myself.urlify(text)), 'floor.png'))
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'))
async def trash(ctx): if len(ctx.message.mentions) == 0: await ctx.send('Please mention someone!') else: async with ctx.message.channel.typing(): av = ctx.message.author.avatar_url toTrash = ctx.message.mentions[0].avatar_url url = 'https://api.alexflipnote.dev/trash?face=' + str(av).replace( 'webp', 'png') + '&trash=' + str(toTrash).replace( 'webp', 'png') data = Painter.urltoimage(url) await ctx.send(file=discord.File(data, 'trash.png'))
async def textimg(ctx, *args): if len(args) == 0: await ctx.send("Input the text!") if len(' '.join(list(args))) > 50: await ctx.send("The word is limit") else: async with ctx.message.channel.typing(): txt = todo.urlify(' '.join(args)) data = Painter.urltoimage( 'https://useless-api--vierofernando.repl.co/texttoimage?text=' + str(txt)) await ctx.send(file=discord.File(data, 'viero.png'))
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!')
async def jpeg(self, ctx): com = str(ctx.message.content).split()[0].replace('jpeg', 'jpegify')[1:] if len(ctx.message.mentions) == 0: avatar = str(ctx.message.author.avatar_url).replace('webp', 'png') else: avatar = str(ctx.message.mentions[0].avatar_url).replace( '.webp', '.png') await ctx.send(file=discord.File( Painter.urltoimage( f'https://api.alexflipnote.dev/filter/{com}?image={avatar}'), 'filtered.png'))
async def notstonk(self, ctx, *args): if len(args) == 0: await ctx.send("Input text tolol") try: join = todo.urlify(' '.join(args)) y = 'https://nezumiyuiz.glitch.me/api/notstonks?avatar=' + str( ctx.author.avatar_url).replace('.webp', '.png') + '&text=' + str(join) await ctx.send( file=discord.File(Painter.urltoimage(y), 'bangpeguigans.png')) except Exception as e: await ctx.send(f"```{e}```")
async def httpdog(self, ctx, *args): code = list(args)[0] if (len(list(args)) != 0) else '404' url = 'https://random-d.uk/api/http/ABC.jpg' if ( 'duck' in ctx.message.content ) else 'https://httpstatusdogs.com/img/ABC.jpg' try: await ctx.send( file=discord.File(Painter.urltoimage(url.replace('ABC', code)), 'httpdogduck.png')) except: await ctx.send('{} | 404'.format( str(self.client.get_emoji(BotEmotes.error))))
async def notstonks(self, ctx, *args): text = str(' '.join(list(args))) if (len(list(args))!=0) else "When you forgot to put the args:" if len(ctx.message.mentions)>0: url = "https://nezumiyuiz.glitch.me/api/notstonks?text={}&avatar={}".format(text.replace(ctx.message.mentions[0].mention, ""), str(ctx.message.mentions[0].avatar_url).replace('.gif', '.webp').replace('.webp?size=1024', '.png?size=512')) else: url = "https://nezumiyuiz.glitch.me/api/notstonks?text={}".format(text) try: async with ctx.message.channel.typing(): await ctx.send(file=discord.File( Painter.urltoimage(url), 'nostonks.png' )) except: await ctx.send('erorr')
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'))
async def dog(self, ctx): async with ctx.message.channel.typing(): links = { "dog": "https://random.dog/woof.json|url", "cat": "https://api.alexflipnote.dev/cats|file", "sadcat": "https://api.alexflipnote.dev/sadcat|file", "bird": "https://api.alexflipnote.dev/sadcat|file", "fox": 'https://randomfox.ca/floof/?ref=apilist.fun|image' } for i in list(links.keys()): if str(ctx.message.content[1:]).lower().replace(' ', '') == i: link = links[i] break apiied = myself.jsonisp(link.split('|')[0])[link.split('|')[1]] data = Painter.urltoimage(apiied) await ctx.send(file=discord.File(data, 'animal.png'))
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))
async def deepfry(self, ctx, *args): if len(ctx.message.mentions) == 0: await ctx.send('Please tag someone!') else: if len(list(args)) == 1: async with ctx.message.channel.typing(): if 'threat' in ctx.message.content: inputtype = 'url' else: inputtype = 'image' av = ctx.message.mentions[0].avatar_url url = 'https://nekobot.xyz/api/imagegen?type=' + str( str(ctx.message.content).split()[0] )[1:] + '&' + inputtype + '=' + str(av)[:-15] + '&raw=1' await ctx.send( file=discord.File(Painter.urltoimage(url), 'lol.png')) else: await ctx.send( str(self.client.get_emoji(BotEmotes.error)) + ' | We do not accept more than 1 arguments!')
async def ship(self, ctx): async with ctx.message.channel.typing(): if len(ctx.message.mentions) != 2: first, second = str(ctx.message.author.avatar_url).replace( 'webp', 'png'), str( random.choice( i.avatar_url for i in ctx.message.guild.members).replace( 'webp', 'png')) else: first, second = str( ctx.message.mentions[0].avatar_url).replace( 'webp', 'png'), str( ctx.message.mentions[1].avatar_url).replace( 'webp', 'png') url = f'https://api.alexflipnote.dev/ship?user={first}&user2={second}' await ctx.send( file=discord.File(Painter.urltoimage(url), 'ship.png'))
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!') elif len(' '.join(list(args))) > 50: await ctx.send( str(self.client.get_emoji(BotEmotes.error)) + ' | too longggggggggg') 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'))
async def distort(self, ctx, *args): try: num = int([i for i in list(args) if i.isnumeric()][0]) except: num = 5 if num not in range(0, 999): return await ctx.send( "{} | damn that level is hella weirdd".format( str(self.client.get_emoji(BotEmotes.error)))) ava = ctx.author.avatar_url if (len( ctx.message.mentions) == 0) else ctx.message.mentions[0].avatar_url ava = str(ava).replace('.gif', '.webp').replace('.webp?size=1024', '.png?size=512') async with ctx.message.channel.typing(): await ctx.send(file=discord.File( Painter.urltoimage( 'https://nezumiyuiz.glitch.me/api/distort?level={}&image={}' .format(str(num), str(ava))), 'distort.png'))
async def food(self, ctx, *args): if len(list(args)) == 0: data = myself.jsonisp('https://nekobot.xyz/api/image?type=' + str(ctx.message.content[1:])) link = data['message'].replace('\/', '/') if 'food' in ctx.message.content: col = int(data['color']) elif 'coffee' in ctx.message.content: col, num = int(data['color']), random.randint(0, 1) if num == 0: link = myself.jsonisp( 'https://coffee.alexflipnote.dev/random.json')['file'] else: link = myself.jsonisp( 'https://nekobot.xyz/api/image?type=coffee' )['message'].replace('\/', '/') async with ctx.message.channel.typing(): data = Painter.urltoimage(link.replace('\/', '/')) await ctx.send( file=discord.File(data, ctx.message.content[1:] + '.png'))
async def nsfw(self, ctx): async with aiohttp.ClientSession() as session: async with session.get( "https://api.ksoft.si/images/random-nsfw", headers={"Authorization": f"Bearer {ksoft_token}"}) as resp: data = await resp.json() embed = discord.Embed() embed.description = "[{}]({})".format(data["title"], data["image_url"]) embed.set_image(url=data["image_url"]) await ctx.send( file=discord.File(Painter.urltoimage( url=data["image_url"]), 'dosatolol.png'))
async def cat(self, ctx): async with aiohttp.ClientSession() as s: async with s.get( "https://api.ksoft.si/images/random-image", params={"tag": "cat"}, headers={"Authorization": f"Bearer {ksoft_token}"}) as resp: data = await resp.json() embed = discord.Embed() embed.description = "Here's some cute cat owo" embed.set_image(url=data["url"]) await ctx.send(file=discord.File(Painter.urltoimage( url=data["url"]), 'bapakmugans.png'))
async def emojiimg(self, ctx, *args): try: em = list(args)[0].lower() if em.startswith('<:a:'): _id, an = em.split(':')[3].split('>')[0], True else: _id, an = em.split(':')[2].split('>')[0], False if an: await ctx.send(file=discord.File( Painter.gif.giffromURL( 'https://cdn.discordapp.com/emojis/{}.gif'.format( _id)), 'emoji.gif')) else: await ctx.send(file=discord.File( Painter.urltoimage( 'https://cdn.discordapp.com/emojis/{}.png'.format( _id)), 'emoji.png')) except: await ctx.send( str(self.client.get_emoji(BotEmotes.error)) + ' | Invalid emoji.')
async def servercard(ctx): bots = [x for x in ctx.guild.members if x.bot] human = [x for x in ctx.guild.members if not x.bot] offline = [ user for user in ctx.guild.members if user.status == discord.Status.offline ] dnd = [ user for user in ctx.guild.members if user.status == discord.Status.dnd ] online = [ user for user in ctx.guild.members if user.status == discord.Status.online ] idle = [ user for user in ctx.guild.members if user.status == discord.Status.idle ] try: sc = f'https://useless-api--vierofernando.repl.co/servercard?icon={ctx.guild.icon_url}&name={ctx.guild}&date=2%20minutes%20ago&author=Todoroki%20Shouto&humans={len(human)}&bots={len(bots)}&roles={len(ctx.guild.roles)}&channels={len(ctx.guild.channels)}&boosters={ctx.guild.premium_subscribers or "0"}&tier={ctx.guild.premium_tier}&online={len(online)}' await ctx.send( file=discord.File(Painter.urltoimage(sc), 'servercard.png')) except Exception as e: await ctx.send(f"```404 ~> {e}```")
async def ytthumbnail(self, ctx, *args): if len(list(args)) != 0: videoid = 'dQw4w9WgXcQ' async with ctx.message.channel.typing(): args = tuple(',,'.join(list(args)).replace('<', '').replace( '>', '').split(',,')) if list(args)[0].endswith('/'): list(args)[0] = list(args)[0][:-1] if 'https://' in list(args)[0]: list(args)[0] = list(args)[0].replace('https://', '') elif 'http://' in list(args)[0]: list(args)[0] = list(args)[0].replace('http://', '') if '/watch?v=' in list(args)[0]: videoid = list(args)[0].split('/watch?v=')[1] else: videoid = list(args)[0].split('/')[1] url = 'https://img.youtube.com/vi/' + str( videoid) + '/mqdefault.jpg' data = Painter.urltoimage(url) await ctx.send(file=discord.File(data, 'thumbnail.png')) else: await ctx.send( str(self.client.get_emoji(BotEmotes.error)) + ' | gimme something to work with! Like a youtube url!')
async def snake(ctx): await ctx.send(file=discord.File( Painter.urltoimage('https://fur.im/snek/i/' + str(random.randint(1, 874)) + '.png'), 'snek.png'))
async def goat(ctx): await ctx.send(file=discord.File( Painter.urltoimage('https://placegoat.com/' + str(random.randint(500, 700))), 'goat.png'))
async def httpcat(self, ctx, *args): if len(list(args)) == 0: code = str(random.randint(200, 550)) else: code = str(' '.join(list(args))) await ctx.send(file=discord.File( Painter.urltoimage('https://http.cat/' + str(code) + '.jpg'), 'httpcat.png'))
async def duck(ctx): await ctx.send(file=discord.File( Painter.urltoimage( todo.jsonisp('https://random-d.uk/api/v2/random?format=json') ['url']), 'duck.png'))
async def amiajoke(self, ctx, *args): if len(ctx.message.content)==0: source = str(ctx.message.author.avatar_url).replace('.gif', '.webp').replace('.webp?size=1024', '.png?size=512') else: source = str(ctx.message.mentions[0].avatar_url).replace('.gif', '.webp').replace('.webp?size=1024', '.png?size=512') if 'bad' in ctx.message.content: url = 'https://api.alexflipnote.dev/bad?image='+str(source) else: url = 'https://api.alexflipnote.dev/amiajoke?image='+str(source) await ctx.send(file=discord.File(Painter.urltoimage(url), 'maymays.png'))