Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ksoft.js

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ksoft.js

Official API Wrapper for KSoft.Si API, written in Node.js

  • 1.0.7
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-41.18%
Maintainers
1
Weekly downloads
 
Created
Source

ksoft.js

Official API Wrapper for KSoft API, written in Node.js

Getting Started

installing...

npm install ksoft.js --save

Using the api examples

// requiring and initiating
const Ksoft = require("ksoft.js");

const ksoft = new Ksoft("YourBrilliantToken")

// images api

// lets get a random meme :)
ksoft.images.getRandomMeme().then(result =>{
    // do whatever you want with the return data
})

// lets get a list of tags to use get images!
ksoft.images.getTags().then(result => {
    // do whatever you want with the return data
})

// lets get a random picture
ksoft.images.getRandomImage(tag).then(result=>{
    // do whatever you want with the return data
})

// There's more which will be listed near the bottom of this page but lets move on to the bans api
let banObject = {
    user: "123456789741" // Users Discord ID that you are banning/reporting
    mod: "123456789742" // Users Discord ID who posted/reported the ban
    user_name: "SomeBadUsername" // Users Discord username that you are banning/reporting
    user_discriminator: "#1234" // Users Discord discriminator that you are banning/reporting
    reason: "Your descriptive reason" // Reason why the user should be globally banned
    proof: "Your proof" // URL of the image showing the act
    appeal_possible: true/false // If appeal should be disabled for that user.
}

// Add a ban
ksoft.bans.add(banObject)

// Get info about a ban
ksoft.bans.getBanInfo(userID).then(result => { // userID is the user you want to get information about
    // do whatever you want with the response
})

// Check if a person is banned
ksoft.bans.check(userID).then(result => { // userID is the user you want to check
    // do whatever you want with the return data
})

// again there's more but lets move on to the kumo api

// lets get information about a location
ksoft.kumo.search(query,fast,more,mapZoom,includeMap).then(result => {
    // do whatever you want with the results
}) /* query is the location you want to get information about. Fast is whether you want to get the information fast but missing a little bit of information. More is if you want the api to return more than one location. mapZoom is how zoomed in you want the map (defaults to 12). IncludeMap is whether you want the map included in the results.*/

// lets get the weather for the place we just searched :)
ksoft.kumo.getSimpleWeather(reportType,q,units,lang,icons).then(result => {
    // do whatever you want with the result
}) /* the reportType is the weather report type. Can be one of: "currently", "minutely", "hourly", "daily". The q is the query, this is the location you want to get weather for. units is the unit type you can select from. Your options are: "si", "us", "uk2", "ca", or "auto". lang is the language you want the results to be in. Your options are: 'ar', 'az', 'be', 'bg', 'bs', 'ca', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'fi', 'fr', 'he', 'hr', 'hu', 'id', 'is', 'it', 'ja', 'ka', 'ko', 'kw', 'nb', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'tet', 'tr', 'uk', 'x-pig-latin', 'zh', or 'zh-tw'. Finally icons is the icon pack you want to choose from. Defualts to original*/

// Again there's more but lets move on to the final api and the one that is my favorite, the lyrics api.

// lets search for a song
ksoft.lyrics.search(q,textOnly,limit).then(result => {
    // do whatever you want with the results
}) /* The q is the query you want to use such as: "Twenty one Pilots Jumpsuit". textOnly is whether you want the api to only search inside the lyrics. limit is how many responses you want it to return. */

// Lets get an artist by their id. You can get the id by searching for a song or an album or whatever.
ksoft.lyrics.getArtistById(id).then(result => {
    // do whatever you want with the results
})
/* All of the api's have jsdoc in them so if your using an editor such as Visual Studio Code (Which I highly recommend) it will give you more information about what you need to put into the paremeters and what exactly each function returns in detail.*/

All functions

Images Api

ksoft.images.getRandomMeme()
ksoft.images.getRandomImage(tag)
ksoft.images.getTags()
ksoft.images.searchTags(tag)
ksoft.images.getImageFromId(snowflake)
ksoft.images.getRandomWikiHow(nsfw)
ksoft.images.getRandomCutePicture()
ksoft.images.getRandomNSFW()
ksoft.images.getRandomReddit(subReddit,removeNSFW,span)

Bans Api

ksoft.bans.add(banData)
ksoft.bans.getBanInfo(userID)
ksoft.bans.check(userID)
ksoft.bans.list(page,perPage)
ksoft.bans.getUpdate(epochDate)

Kumo Api

ksoft.kumo.search(q,fast,more,mapZoom,includeMap)
ksoft.kumo.getSimpleWeather(reportType,q,units,lang,icons)
ksoft.kumo.geoip(ip)

Lyrics Api

ksoft.lyrics.search(q,textOnly,limit)
ksoft.lyrics.getArtistById(id)
ksoft.lyrics.getAlbumById(id)
ksoft.lyrics.getTrackById(id)

Special thanks to sdf for helping me troubleshoot some stuff :)

Keywords

FAQs

Package last updated on 14 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc