Giter Site home page Giter Site logo

kifo's Introduction

kifo

NPM package to make the Kifo Clanker™ cleaner and easier to manage.

Installation

  1. npm install kifo in your terminal
  2. const kifo = require("kifo"); in your code

... and that's it!

make sure you have npm installed.

Features

Main usage of this package is to help develop Kifo Clanker™. However, there are some actually useful features that other bot developers could use (like RegExs).

embed(body, title = "Info:", perpetrator = null, client = null)

converts string (body) with optional title to embed message.

  • perpetrator - Discord.User that used the command (visible in footer)
  • client - Discord.Client that instantiated this (visible in title)

mentionTrim(mention)

Trims mentions to Ids. For instance, "<@KifoPL>" returns "KifoPL", "<@&123123123>" returns "123123123", "42069" returns "42069".

  • mention - string to trim.

emojiTrim(emojiIdentifier)

Returns Id of emoji, really handy for handling reactions, etc.

  • emojiIdentifier - The <a:name:id>, <:name:id>, a:name:id or name:id emoji identifier string of an emoji

place(number)

returns number with place abbreviation: for 1 returns 1st, 2 - 2nd, etc...

number - the place

whatAmIFunc(message, whatisthis, allowWords, callback)

Determines, what the mention or Id is.

  • message - The message sent
  • whatisthis - The argument in question (either mention or Id)
  • allowWords - True if "me" results in member and "here" in channel (case in-sensitive), false otherwise.
  • callback -
{
	entity: Discord.GuildMember || Discord.GuildChannel || Discord.GuildRole || Discord.Message || undefined,
	whatAmI: "member" || "channel" || "role" || "message" || "not found" //(that's because if the function breaks, it will return `undefined`, + it's easier to do if statements)
}

emojiRegex

Returns RegEx fitting all Unicode Emojis.

urlRegex

Returns RegEx fitting all URLs starting with http:// or https://

channelPerms

Returns array with Id, name, type, aliases of channel perms.

example:

	[
		(VIEW_CHANNEL = {
		Id: 1,
		name: "VIEW_CHANNEL",
		type: "text",
		aliases: ["view", "vch"],
	}),
	...
	]

Links

kifo's People

Contributors

kifopl avatar

Watchers

 avatar

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.