Giter Club home page Giter Club logo

nekos-dot-life's Introduction

npm npm install size

NPM

Nekos.life

Installation

npm i -s nekos.life

Official wrapper for nekos.life! Very small install size with no external dependencies.

Please note that NSFW endpoints and images have been removed from the API

This is a breaking change, please alter your code to reflect the breaking change.

Endpoints

Function Description
smug Gets a URL of a smug image/gif
baka Gets a URL of a baka image/gif
tickle Gets a URL of a tickle image/gif
slap Gets a URL of a slap image/gif
poke Gets a URL of a poke image/gif
pat Get a URL of a pat image/gif
neko Get a URL of a neko image
nekoGif Get a URL of a neko gif
meow Get a URL of a cat image/gif
lizard Get a URL of a lizard image
kiss Get a URL of a kiss image/gif
hug Get a URL of a hug image/gif
foxGirl Get a URL of a fox girl image/gif
feed Get a URL of a feeding image/gif
cuddle Get a URL of a cuddle image/gif
kemonomimi Get a URL of a kemonomimi image/gif
holo Get a URL of a Holo image/gif
woof Get a URL of a dog image/gif
wallpaper Get a URL of a wallpaper
goose Get a URL of a goose image
gecg Get a URL of a gecg (genetically engineered catgirl) image
avatar Get a URL of an avatar image
waifu Get a URL of a waifu image
why Get text of a question
catText Get text of a cat emoji
OwOify Get OwOified text of a string
eightBall Sends the text and replies with a text as a response to the magic 8Ball and an image as well.
fact Gets the text and replies with a text that is a random fact
spoiler Creates an individual spoiler per letter for Discord

All of the endpoints but the ones marked with text, except Chat/8Ball/Fact in the description will return JSON: { url: <theURL>}.

neko.catText will return JSON: {cat: <catemoji>}
neko.why will return JSON {why: <whytext>}
neko.OwOify will return JSON {owo: <owoified string>}

neko.fact will return JSON {fact: <fact string>}
neko.eightBall will return JSON {response: <8Ball response string>, url: <URL to a matching 8Ball image>}

As of now, OwOify and eightBall are the only ones with query parameters. It requires an object containing the parameter, and the key should be the value. In this case, the key is text and the value is whatever you want OwOified. There is an example in this README. {text: 'Some text you want weebified.}

Typings

I added a typings file and will be working to improve it. This allows editors like VSC to use intellisense/autocomplete to suggest functions and help out with parameters and to see what you'll be receiving as a result of function calls.

Examples

Await/Async example

const client = require('nekos.life');
const neko = new client();

async function test() {
  console.log(await neko.hug());
}

test();

returns:

{ url: 'https://cdn.nekos.life/hug/hug10050.gif' }

Promise example

const client = require('nekos.life');
const neko = new client();

neko.catText().then((catText) => console.log(catText));

returns

{ cat: '((≡^⚲͜^≡))' }

OwOify example

const client = require('nekos.life');
const neko = new client();

async function work() {
  let owo = await neko.OwOify({text: 'This lib is really awesome!'});
  console.log(owo);
}

work();

returns

{ owo: 'This wib is weawwy awesome >w< ' }

nekos-dot-life's People

Contributors

arktn avatar cfanoulis avatar emy avatar iamtails avatar lostigeros avatar nirajn2311 avatar thecyberronin avatar zegszub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nekos-dot-life's Issues

bug

I recently tried to add NSFW commands to my bot using this library, but I get this error:
TypeError: client is not a constructor.
where my code is:
const Discord = require('discord.js') const client = new Discord.Client() const config = require('./config.json') const command = require('./command') const poll = require('./poll') const memberCount = require('./memberCount') const fs = require("fs"); const hentai = require('./hentai') const neko = require('nekos.life') const neki = new client();

what should I do to resolve this problem?

Create an issue template

Create a typical issue template with a section for a description of the issue, expected result, and how to repeat the issue.

API (and website as a whole) is down

Describe the bug
Read the title.

To Reproduce
Steps to reproduce the behavior:

  1. Go to nekos.life
  2. See error
  3. Panic internally

Expected behavior
Uh, not an error?

Many API endpoints don't work (except when using an older version of the wrapper)

Describe the bug
When using https://nekos.life/api/v2/img/:endpoint many endpoints don't work and return a 404 message that reads:
{"msg":"404"}
Here is a list of all the not working endpoints I found:
baka, poke, nekoGif, foxGirl, kemonomimi, holo
But for some reason when using an older version (2.0.7) of the wrapper I could for example use the foxGirl endpoint and I would even get a result that linked to https://cdn.nekos.life/fox_girl/foxgirl_85.jpg (that link is working at the moment).

To Reproduce
Not working API endpoints:
Go to: https://nekos.life/api/v2/img/foxGirl (The endpoint can be changed to any endpoint of the list I created in this issue.)
Result: {"msg":"404"}

Working older nekos.life wrapper version:
1. Install version 2.0.7 of the nekos.life wrapper.
2. Run the sfw.foxGirl() function and get the result.
Result: {"url":"https://cdn.nekos.life/fox_girl/foxgirl_85.jpg"}

Expected behavior
Both should either give us a JSON similar to the result of the older wrapper or a 404 error.

Desktop (please complete the following information):

  • OS: Windows 10 Home
  • OS version: 21H2
  • Node version: 16.13.1

Additional context
This is an expansion of the over one month old #44 issue.

Slow promise

Slow promise
Sometime i getting slow promise when fetch any nekos through this wrapper,
but when i fetched manual with node-fetch example: https://www.nekos.life/api/v2/img/wallpaper
with node-fetch the image return is fast properly, also i'm not using any kind of delay function.

Desktop

  • Node version 14.5.0

Ty sir

Need help

How do i use commands on discord bots? idk how to make stuff like

const {sfw} = new client();
 
sfw.neko().then(neko => console.log(neko));

on discord. it keeps saying "invalid body form" and that its not a string. how do i use it?

Add sfw.chat back again

Describe new features you want
chat function was removed.

Describe the solution you'd like
add it back

Describe alternatives you've considered
none

Additional context
none

A Gif to describe how you feel when you made this request
none

nekos.life API doesn't work

I'm having problem with nekos.life. Each time I run my 1cat command, that should return cat, it returns error, that it can't connect to server.

Add cry

Describe new features you want
add cry random images

Describe the solution you'd like
Add it to the package

question

for any usage of this wrapper, i need to request via async? thanks.

Unresponsive Commands

Describe the bug
A clear and concise description of what the bug is.
I don't know why but any command I use involving a nekos.life command won't work when I am hosting my .js bot on my linux machine. (Linux Mint). I have npm, nodejs, etc. on it already and everything works fine with other bots.

To Reproduce
Steps to reproduce the behavior: Have Linux mint on your laptop or computer, have
Nodejs, and npm installed then either git clone from github or copy and paste folder from thumb drive to computer. Then start up the bot using terminal window/shell.

Expected behavior
All commands to work fine like they do on my windows laptop. (What I get is all my other commands work, except the nekos.life commands)

Desktop (please complete the following information):

  • OS: Linux Mint
  • Node version: v12.17.0

Additional context
The bot you can see here is online.

IMG_20200529_121542
unknown2

When Commands are entered, No response. (Other commands like, help, and whois, work just fine.
unknown

As you can see here.
unknown3

Notes
The bot and the nekos.life commands work functionally well when hosted on my widows 10 laptop. The files used in both folders are identical except the .bat file to start it is now a .sh but the code in the files are the same.

Cannot support via Sponsor

Describe the bug
When attempting to support the project via the Sponsor button, I get an error that one of the users provided in the FUNDING.yaml isn't registered for sponsors.

To Reproduce
Click the Sponsor button at the top of the repo.

Expected behavior
I've never sponsored a repo before so I'm not entirely sure what it should look like.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Node version [node -v]
    N/A

bug

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Node version [node -v]

Additional context
Add any other context about the problem here.

Divide the NSFW and SFW functions a bit more

Describe new features you want
Currently, all of the available endpoints are exposed via the NekoClient class as individual functions. It would be great if you could instantiate the module but say you only want the SFW functions at the moment.

Describe the solution you'd like
The NekoClient class constructor would have one optional parameter contentType. If undefined, it would assign all functions as usual so it's still backward compatible.

If contentType is SFW or NSFW, then only assign those functions to the class.

Describe alternatives you've considered
At first, I thought it would be easier to just export a SFW and NSFW object in the NekoClient class that you could choose. After tinkering with it some more I realized this would break backward compatibility as any previous code relying on the function calls would then have to add a sfw or nsfw prefix to the function call.

Additional context
I've created a working version of this on my fork, but I'm not entirely sure how to show this new conditional function stuff in TypeScript. So at the moment, when you install my fork it still shows all of the functions exported as usual no matter what.

However, if you do something like the following, you'll get a function not found error:

const Neko = require('nekos.life')
const neko = new Neko('sfw')

neko.getNSFWBoobs()
  .then(res => console.log(res.url))
  .catch(err => console.error(err))

A Gif to describe how you feel when you made this request
LWA

8Ball doesn't work, well atleast using traditional method.

Adding 8Ball will always result in a problem saying:
An identifier or keyword cannot immediately follow a numeric literal.

The problem is as simple as replacing any neko.sfw. with neko.sfw.8Ball

Perhaps i was just doing it wrong? All i did was just copy the example and replace the stuff with 8Ball. It should've worked because i already got a dozen working .js files that uses the same method.

  • OS: Windows 10
  • Node version v16.11.1

Note: Discord.js

How Do I send this as a Message Embed with the picture

This is a problem on my end for sure, but I am confused as to how I turn this

const client = require('nekos.life');
const neko = new client();

neko.nsfw.neko().then(neko => {console.log(neko);});

Into a message embed with a picture each time.

Bug report: I get ECONNREFUSED when I request from my app

Describe the bug
I am not sure if this is a bug, but when I request from my app (discord bot) it gives me error Error: connect ECONNREFUSED 0.0.0.0:443
But when I open the same url in my browser it works, so I doubt if this is a bug

To Reproduce
Steps to reproduce the behavior:

Request to any endpoint of the nekos.life api v2 with nodejs + axios

Sample Code:

require("axios")({ method: "get", url: "https://nekos.life/api/v2/img/tickle" }).then(data => console.log(data.res)).catch(err => console.log(err));

Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Linux
  • Node version [node -v] v16.13.0

Additional context
Also I didn't use this wrapper I just used the main api directly, I found this as the official wrapper so I came to report here
Let me know if you want me to try with this wrapper

Thanks in advance

Create a feature request template

Please create a feature request template. A good one might contain a good description of the feature like a function and an example output of it as well as why it would be a good feature to add.

.sfw.wallpaper() also returns nsfw wallpapers

I am using this in a discord bot and despite the wallpaper() method being in the sfw property, it still has a chance of returning a nsfw wallpaper.

Here is the code block where I am using this

case '-wallpaper':
    NekoClient.sfw.wallpaper().then(image => {
        console.log(Utils.getTimeStamp() + 'Fetched url ' + image.url);
        NekoEmbed.setDescription('Wallpaper');
        NekoEmbed.setImage(image.url);
    }).then(fuckyoujavascript => {
        msg.channel.send(NekoEmbed);
    });
    break;

Why they removed NSFW endpoints?

I wanted to know if they completely removed the nsfw endpoints from the api and npm or if they just changed the name of the endpoint

Anime Roleplay commands won't work.

Anime Roleplay commands such as hug, pat, kiss, baka etc aren't working since Yesterday.

And whenever someone uses the command, the bot throws this error.

Error: connect ECONNREFUSED 0.0.0.0:443

image

I don't know if this is an issue with the API itself. Since I didn't change my code and it's working perfectly fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.