async def _(event): "Search cute cats." reply_to = await reply_id(event) target = nekos.cat() catevent = await edit_or_reply(event, "`Finding ur ket...`") await event.client.send_file(event.chat_id, file=target, reply_to=reply_to) await catevent.delete()
async def __call__(self, args, argv, flags, channel, **void): isNSFW = is_nsfw(channel) if "l" in flags: available = [] text = "Available tags in **" + channel.name + "**:\n```ini\n" for key in neko_tags: if isNSFW or not neko_tags[key] == True: available.append(key) text += str(sorted(available)) + "```" return text tagNSFW = False selected = [] for tag in args: tag = tag.replace(",", "").lower() if tag in neko_tags: if neko_tags.get(tag, 0) == True: tagNSFW = True if not isNSFW: raise PermissionError( "This command is only available in " + uniStr("NSFW") + " channels." ) selected.append(tag) for _ in loop(flags.get("r", 0)): possible = [i for i in neko_tags if neko_tags[i] <= isNSFW] selected.append(possible[xrand(len(possible))]) if not selected: if not argv: url = nekos.img("neko") else: raise EOFError( "Search tag " + argv + " not found. Use ?l for list.") else: v = xrand(len(selected)) get = selected[v] if get == "gif": if tagNSFW: url = nekos.img("nsfw_neko_gif") else: url = nekos.img("ngif") elif get == "cat": url = nekos.cat() elif get == "404": url = nekos.img("smallboobs") else: url = nekos.img(get) if "v" in flags: text = "Pulled from " + url return text emb = discord.Embed( url=url, colour=randColour(), ) emb.set_image(url=url) print(url) return { "embed": emb }
async def _(message: Message): target = nekos.cat() reply = message.reply_to_message reply_id = reply.message_id if reply else None # await message.edit("`Hold on! Your Cat iz Coming..`") if reply: await message.reply_photo(target, reply_to_message_id=reply_id) else: await message.client.send_photo(message.chat.id, photo=target) await message.delete()
def inline_search_neko(update: Update, context: CallbackContext): query = update.inline_query.query neko_url = nekos.cat() s = query.replace('tc', '') update.inline_query.answer(results=[ InlineQueryResultPhoto( id=uuid4(), photo_url=neko_url, title='Neko', thumb_url=neko_url )])
async def _(event): await event.delete() reply_to_id = event.message if event.reply_to_msg_id: reply_to_id = await event.get_reply_message() with open("temp.png", "wb") as f: f.write(requests.get(nekos.cat()).content) img = Image.open("temp.png") img.save("temp.webp", "webp") img.seek(0) await bot.send_file(event.chat_id , open("temp.webp", "rb"),reply_to=reply_to_id)
async def _(event): "To get random cat stickers." await event.delete() reply_to_id = await reply_id(event) with open("temp.png", "wb") as f: f.write(requests.get(nekos.cat()).content) img = Image.open("temp.png") img.save("temp.webp", "webp") img.seek(0) await event.client.send_file( event.chat_id, open("temp.webp", "rb"), reply_to=reply_to_id ) remove("temp.webp")
async def _(event): if event.fwd_from: return try: await event.delete() except BaseException: pass reply_to_id = event.message if event.reply_to_msg_id: reply_to_id = await event.get_reply_message() with open("temp.png", "wb") as f: f.write(requests.get(nekos.cat()).content) img = Image.open("temp.png") img.save("temp.webp", "webp") img.seek(0) await event.client.send_file(event.chat_id, open("temp.webp", "rb"), reply_to=reply_to_id) remove("temp.webp")
def cat(self) -> str: try: self.cat_image_url = nekos.cat() except nekos.errors.NothingFound: log.exception("Nothing found on Nekos.py for this cat request") return except nekos.errors.EmptyArgument: log.exception("Empty argument") return except nekos.errors.InvalidArgument: log.exception("Invalid argument for nekos.py") return except nekos.errors.NekoException: log.exception("Some other error ocurred on Nekos.py execution.") return log.debug( f"Got image API response from Nekos.py on cat, sending the following image url {str(self.cat_image_url)}" ) return str(self.cat_image_url)
def fetch_one(self): if not self.header or random.random() > 2 / 3: if random.random() > 2 / 3: url = nekos.cat() else: for _ in loop(8): resp = requests.get( "https://api.alexflipnote.dev/cats", headers=self.header, timeout=8, ) try: d = json.loads(resp.content) except: d = eval(resp.content, {}, eval_const) try: if type(d) is list: d = random.choice(d) url = d["file"] break except KeyError: pass time.sleep(0.25) else: for _ in loop(8): resp = requests.get( "https://api.thecatapi.com/v1/images/search", headers=self.header, timeout=8, ) try: d = json.loads(resp.content) except: d = eval(resp.content, {}, eval_const) try: if type(d) is list: d = random.choice(d) url = d["url"] break except KeyError: pass time.sleep(0.25) return url
async def __call__(self, channel, flags, **void): if not self.header or random.random() > 0.9375: url = nekos.cat() else: for _ in loop(8): returns = [None] doParallel( funcSafe, [requests.get, "https://api.thecatapi.com/v1/images/search"], returns, {"headers": self.header}, ) while returns[0] is None: await asyncio.sleep(0.5) if type(returns[0]) is str: print(eval, returns[0]) raise eval(returns[0]) resp = returns[0][-1] try: d = json.loads(resp.content) except: d = eval(resp.content, {}, {}) try: if type(d) is list: d = random.choice(d) url = d["url"] break except KeyError: await asyncio.sleep(0.5) if "v" in flags: text = "Pulled from " + url return text emb = discord.Embed( url=url, colour=self._vars.randColour(), ) emb.set_image(url=url) print(url) create_task(channel.send(embed=emb))
async def cat(ctx): embed = discord.Embed(color=bot_color, description="an image of a cat") embed.set_image(url=nekos.cat()) await ctx.send(embed=embed)
async def kitty(self, ctx): "sendds cat image" await ctx.send(nekos.cat())
async def ncat(self, ctx): """Displays a cat.""" cat_url = nekos.cat() e = discord.Embed(title="Here is a kitty cat for you {}.".format(ctx.author.name), color=discord.Color.dark_green()) e.set_image(url=cat_url) await ctx.send(embed=e)
def cat(): return http.status({'url': nekos.cat()}, 200)
async def cat(self, ctx): some_cat = nekos.cat() e = discord.Embed(title="Meow~", color=0x36393E) e.set_image(url=some_cat) await ctx.send(embed=e)
async def cat(self, ctx): """Cats are the best! I mean, this sends you an image of a cat""" e = await self.__create_embed("Meow~", nekos.cat()) await ctx.send(embed=e)
async def cat(ctx): catimg = nekos.cat() await ctx.send(catimg)
async def cat(self, ctx): url = nekos.cat() em = discord.Embed(title="Meow! 😺", color=discord.Color.blue()) em.set_image(url=url) em.set_footer(text="Powered by nekos.life") await ctx.send(embed=em)
def show_neko_img(update: Update, context: CallbackContext): update.message.reply_photo(photo=nekos.cat(), quote=False)
async def _(event): target = nekos.cat() await event.edit("Finding ur ket...🌚") await event.client.send_file(event.chat_id, file=target) await event.delete()
async def picture(self, ctx, category=None): if not category: await ctx.send('Укажите категорию!', delete_after=20) elif category == 'cat' or category == 'кот': cate = nekos.cat() emb = discord.Embed(title='Котик', colour=0xFFFF00).set_image(url=cate) await ctx.send(embed=emb, delete_after=30) elif category == 'niga' or category == 'негр': niga = [ 'https://pp.userapi.com/c854220/v854220634/85517/DHd7sQSMj1w.jpg', 'https://pp.userapi.com/c7003/v7003293/6666f/HXL2tqecltc.jpg', 'https://pp.userapi.com/c845120/v845120976/107eda/eXrmmB7e1mU.jpg', 'https://pp.userapi.com/c848632/v848632123/f08ea/lIbE35c1-xo.jpg', 'https://pp.userapi.com/c635103/v635103260/53ce5/fPqWBHrwxDs.jpg', 'https://sun9-11.userapi.com/c848528/v848528900/de57b/yCRj3AzAjhk.jpg', 'https://pp.userapi.com/c846021/v846021236/158e98/zk5D9NbQKWU.jpg', 'https://pp.userapi.com/c846217/v846217824/1034ec/VdG0wv6bjU8.jpg', 'https://pp.userapi.com/c540100/v540100156/5004a/5I-R0zGmXF8.jpg' ] num = random.choice(niga) await ctx.send(embed=discord.Embed( title='**niga**', colour=0x0000FF).set_image(url=num), delete_after=30) elif category == 'anime_t9n' or category == 'wallpaper' or category == 'content' or category == 'hentai' or category == '4len': if ctx.message.channel.is_nsfw() == True: if category == 'anime_t9n' or category == 'аниме_тян': num = random.randint(1, 2) if num == 1: ngif = nekos.img('ngif') await ctx.send(embed=discord.Embed( title='**Аниме тян +18**', colour=0xFF00FF).set_image(url=ngif), delete_after=20) else: fox_girl = nekos.img('fox_girl') await ctx.send(embed=discord.Embed( title='**Аниме тян +18**', colour=0xFF00FF).set_image(url=fox_girl), delete_after=20) elif category == 'wallpaper': wallpaper = nekos.img('wallpaper') await ctx.send(embed=discord.Embed( title='**Рандомныя картинка +18**', colour=0x0080FF).set_image(url=wallpaper), delete_after=20) elif category == 'content' or category == 'контект': porno = [ 'https://pp.userapi.com/c635107/v635107235/10bac/U_4n0s8Wauo.jpg', 'https://pp.userapi.com/c849120/v849120574/176655/S0KgWg937vU.jpg', 'https://pp.userapi.com/c848524/v848524215/183447/XpVd2kwa1CI.jpg', 'https://sun9-33.userapi.com/c852024/v852024215/11b6f0/K_FKn3gyzAA.jpg', 'https://pp.userapi.com/c847221/v847221473/1f420c/PKDlfWiW_Zo.jpg', 'https://pp.userapi.com/c850336/v850336379/13d5d7/u3eofibL0yc.jpg', 'https://pp.userapi.com/c851032/v851032957/116ae2/E5J3wz9UiN4.jpg', 'https://pp.userapi.com/c846017/v846017918/1f3761/8vmSoG8bdzU.jpg', 'https://pp.userapi.com/c635107/v635107566/11a8a/USsHHOERPGU.jpg', 'https://pp.userapi.com/c856136/v856136919/9da41/wj0YYV2Fylw.jpg', 'https://pp.userapi.com/c850136/v850136926/192169/rRsbEIqHhVU.jpg', 'https://pp.userapi.com/c831409/v831409001/16ceee/VFoGYjBY4G4.jpg', 'https://pp.userapi.com/c849136/v849136855/1d37bc/j1hKpqizpXM.jpg', 'https://pp.userapi.com/c851228/v851228650/174f23/UWu-M7gD38s.jpg', 'https://pp.userapi.com/c848620/v848620571/d17ac/3E-y7uMSQEU.jpg', 'https://sun9-17.userapi.com/c846419/v846419643/1a0b5d/CBgobtBeS_s.jpg', 'https://pp.userapi.com/c849432/v849432403/1bc592/xbZggYVA6yY.jpg', 'https://pp.userapi.com/c850628/v850628647/159645/vn180hkZ5AM.jpg', 'https://pp.userapi.com/c851132/v851132957/15e3f8/FGwzk6VTqQg.jpg', 'https://pp.userapi.com/c851132/v851132957/15e402/Z0HAP7pPluA.jpg', 'https://pp.userapi.com/c852032/v852032400/13edaf/9E0aIPTzIWY.jpg', 'https://pp.userapi.com/c847124/v847124187/b8f60/BUrl9OE3Lxw.jpg', 'https://pp.userapi.com/c854220/v854220906/5aef2/R7T0naIrfcY.jpg' ] num = random.choice(porno) await ctx.send(embed=discord.Embed( title='**Content** `+18`', colour=0x0000FF).set_image(url=num), delete_after=20) elif category == 'hentai' or category == 'хентай': hentai = nekos.img('random_hentai_gif') await ctx.send(embed=discord.Embed( title='**Hentai +18**', colour=0x0000FF).set_image(url=hentai), delete_after=20) elif category == '4len' or category == 'Член': chlen = [ 'https://cdn.gayboystube.com/galleries/1815445a37fea083e17/5a37feec52e00.jpg', 'https://img-hw.xvideos.com/videos/profiles/galleries/8a/00/71/joy1972/gal153886/pic_118_big.jpg', 'http://www.allpornhome.com/aegalleries/02-amateurbigcocks-52/004.jpg', 'http://x.imagefapusercontent.com/u/eldivino/3479589/1646560075/pollazos_1428345662.jpg', 'http://dattr.com/p_content_dattr/d0beda63b295538ae1bcfee8a531a962fd3e7508/dattrcom9363cc08932408cc87c46d66f325b5762c2427a5.jpg', 'https://dl.backbook.me/full/5f92b8a03b.jpg', 'https://www.hoodtube.com/images/galleries/0386/3475/a014fc48834cba870880c3c383a35510.jpg', 'https://thumb-p9.xhcdn.com/a/w1HFdnPGBczNkc1LIeZ-wg/000/046/216/729_1000.jpg', 'http://x.fap.to/images/full/42/333/333608989.jpg', 'https://annamilk.com/wp-content/uploads/2015/05/bolshoj-chlen-u-parnyabolshoj-chlen-u-parnya_07.jpg' ] num = random.choice(chlen) await ctx.send(embed=discord.Embed( title='**4len +18**', colour=0x0000FF).set_image(url=num), delete_after=20) else: await ctx.send( 'Чтобы использовать эту команду перейдите в NSFW канал!', delete_after=30) else: await ctx.send('Напишите правильно команду!', delete_after=20)
async def cat(ctx): emb = discord.Embed(description=f'**Вот тебе котик:**', color=0x6fdb9e) emb.set_image(url=nekos.cat()) await ctx.send(embed=emb)