Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

All Methods

Foo edited this page Apr 30, 2020 · 1 revision

KSoft.Net

Contents

KSoftApi(accountToken) class

Summary

KSoft API class

Parameters
Name Type Description
accountToken System.String Token from your dashboard https://api.ksoft.si/dashboard

AddBan(userID, reason, proof, mod, userName, userDiscriminator, appealPossible) method

Summary

This endpoint allows you to add bans to the list. If you don't have BAN_MANAGER permission your ban will be automatically converted to a ban report and we will take a look and act accordingly.

Returns

KSoftBan

Parameters
Name Type Description
userID System.Int64 Users Discord ID that you are banning/reporting
reason System.String Reason why user should be globally banned
proof System.String URL of the image showing the act
mod System.Int64 Users Discord ID who posted/reported the ban
userName System.String Users Discord username
userDiscriminator System.String Users Discord discriminator
appealPossible System.Boolean If appeal should be disabled for that user.

AdvancedWeather(latitude, longitude, reportType, units, language, icons) method

Summary

Gets weather by coordinates, this endpoint is faster than weather - easy, because it doesn't need to lookup the location.

Returns

KSoftWeather

Parameters
Name Type Description
latitude System.Single Latitude coordinate
longitude System.Single Longitude coordinate
reportType System.String Select weather type. Can be one of: "currently", "minutely", "hourly", "daily"
units System.String Default: auto, select units, you can choose from: "si", "us", "uk2", "ca", "auto"
language System.String Default: en, select language, all available languages: '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', 'zh-tw'
icons System.String Default: original, select icon pack

AlbumByID(id) method

Summary

Retrieves artist name and all tracks in the album.

Returns

KSoftAlbumInfo

Parameters
Name Type Description
id System.Int32 Album ID, you can get it from the lyrics search

ArtistByID(id) method

Summary

Retrieves all albums and songs by that artist.

Returns

KSoftArtistInfo

Parameters
Name Type Description
id System.Int32 Artist ID, you can get it from the lyrics search

BanCheck(userID) method

Summary

Simple way to check if the user is banned

Returns

KSoftBanCheck

Parameters
Name Type Description
userID System.Int64 Users Discord ID that you'd like to check

BanInfo(userID) method

Summary

Get more information about a ban

Returns

KSoftBanInfo

Parameters
Name Type Description
userID System.Int64 Users Discord ID who's ban you'd like to check

BanList(page, perPage) method

Summary

Pagination of bans, you can request up to 1000 records per page, default is 20.

Returns

KSoftBanList

Parameters
Name Type Description
page System.Int32 Page number (default: 1)
perPage System.Int32 Number of bans per page (default: 20)

BanUpdates(timestamp) method

Summary

Gets updates from the previous update

Returns

KSoftBanUpdates

Parameters
Name Type Description
timestamp System.DateTimeOffset Timestamp in seconds from 1.1.1970 (epoch time)

BasicWeather(reportType, query, units, language, icons) method

Summary

Gets weather by location.

Returns

KSoftWeather

Parameters
Name Type Description
reportType System.String Select weather report type. Can be one of: "currently", "minutely", "hourly", "daily"
query System.String Location query
units System.String Default: auto, select units, you can choose from: "si", "us", "uk2", "ca", "auto"
language System.String Default: en, select language, all available languages: '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', 'zh-tw'
icons System.String Default: original, select icon pack

CurrencyConversion(from, to, value) method

Summary

Currency conversion.

Returns

KSoftCurrency

Parameters
Name Type Description
from System.String ISO Standard for 3 letter currency naming: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
to System.String ISO Standard for 3 letter currency naming: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
value System.Single Float or Integer you want to convert

DeleteBan(userID, force) method

Summary

Delete a ban, only users with BAN_MANAGER permission can use this.

Returns

KSoftBanDeletion

Parameters
Name Type Description
userID System.Int64 Users Discord ID
force System.Boolean Default: false, if true it deletes the entry from the database instead of deactivating

Execute(request) method

Summary

Method to execute requests

Returns

Type provided

Parameters
Name Type Description
request RestSharp.RestRequest Rest request to execute
Generic Types
Name Description
T Type to return

GeoIP(ip) method

Summary

Gets location data from the IP address.

Returns

KSoftGeoIP

Parameters
Name Type Description
ip System.String IP address

ImageFromSnowflake(snowflake) method

Summary

Retrieve image data.

Returns

KSoftImage

Parameters
Name Type Description
snowflake System.String Image snowflake (unique ID)

RandomAww() method

Summary

Get random cute pictures, mostly animals.

Returns

KSoftRedditPost

Parameters

This method has no parameters.

RandomImage(tag, nsfw) method

Summary

Gets random image from the specified tag.

Returns

KSoftImage

Parameters
Name Type Description
tag System.String Default: false, if to show nsfw content
nsfw System.Boolean Name of the tag

RandomMeme() method

Summary

Retrieves a random meme from the cache. Source: reddit

Returns

KSoftRedditPost

Parameters

This method has no parameters.

RandomNsfw(gifs) method

Summary

Retrieves random NSFW pics. (real life stuff)

Returns

KSoftRedditPost

Parameters
Name Type Description
gifs System.Boolean Default: false, if to retrieve gifs instead of images

RandomReddit(subreddit, removeNsfw, span) method

Summary

Retrieve images from the specified subreddit.

Returns

KSoftRedditPost

Parameters
Name Type Description
subreddit System.String Specified subreddit
removeNsfw System.Boolean Default: false, if set to true, endpoint will filter out nsfw posts.
span System.String Default: "day", select range from which to get the images. Can be one of the following: "hour", "day", "week", "month", "year", "all"

RandomWikiHow(nsfw) method

Summary

Retrieves weird images from WikiHow

Returns

KSoftWikiHowPost

Parameters
Name Type Description
nsfw System.Boolean Default: false, if to display nsfw content.

SearchLocation(query, fast, more, mapZoom, includeMap) method

Summary

You can get coordinates and more information about the searched location, if needed image of the area is generated.

Returns

KSoftLocation

Parameters
Name Type Description
query System.String Your location query
fast System.Boolean Default: fast, return location data faster, but with less information
more System.Boolean Default: false, return more than one location
mapZoom System.Int32 Default: 12, set your own zoom level, if fast is not set or false, then this setting will be ignored because map zoom is calculated
includeMap System.Boolean Default: false, if to include an image of the area

SearchLyrics(query,textOnly, limit) method

Summary

Searches for lyrics and returns a list of results.

Returns

KSoftLyrics

Parameters
Name Type Description
query System.String Search query.
textOnly System.Boolean Default: false, if set to 'true' then it only searches inside the lyrcis.
limit System.Int32 Default: 10, how many results should the endpoint return.

TagSearch(query) method

Summary

Search for tags.

Returns

KSoftTags

Parameters
Name Type Description
query System.String Search query

Tags() method

Summary

Retrieve the list of all available tags.

Returns

KSoftTags

Parameters

This method has no parameters.

TrackByID(id) method

Summary

Get info about a song.

Returns

KSoftTrackInfo

Parameters
Name Type Description
id System.Int32 Track ID, you can get it from artist by id, album by id or lyrics search endpoints
Clone this wiki locally