New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

discord-utilities

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-utilities

A lightweight and easy to use package with utility functions that you may need when developing a discord bot.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

discord-utilities

A lightweight, updated and easy to use package with utility functions that you may need when developing a discord bot or javascript programs.

Bugs, Glitches & Issues

Open an issue in our github repository.

Help & Support

If you need help, join our discord server to talk and help with your code.

Installation

You can easily get it from NPM.

npm install discord-utilities

Functions

Reffering to Utils as const Utils = require("discord-utilities");.

Function NameCallDescriptionOutput
shuffleArrayUtils.shuffleArray(array)Shuffles elements of a given array.Array
randomItemUtils.randomItem(array)Selects a random item of a given array.ArrayItem
isArrayUtils.isArray(parameter)Returns if the given parameter is an array.Boolean
randomHexUtils.randomHex()Returns a vaid and random hexadecimal color code.String
randomNumberUtils.randomNumber(minimum, maximum)Returns a random number from inside minimum and maximum range. (Interval [minimum, maximum])Integer
randomStringUtils.randomString(length)Returns a random combination of letters and numbers of a specified length.String
roundFloatUtils.roundFloat(float, decimals)Default amount of decimals is 1. It keeps/adds decimals until the desired amont of decimals is hit.Float
includesNumberUtils.includesNumber(string)Returns true if the string contains any numbers inside it.Boolean
isNumberUtils.isNumber(parameter)Returns true if the given parameter is a finited number.Boolean
fetchTimeUtils.fetchTime(ms, object)It fetches the amount of ms to human readable time, If object function is set to true, it will output an object with the values, otherwise it will output a formated string, false by default.String or Object
toProperCaseUtils.toProperCase(string)It sets the first letter of every word inside the string to upper case.String
isObjectUtils.isObject(parameter)It returns true if given parameter is a JSON object.Boolean
waitUtils.wait(ms)Creates a promise that gets resolved after amount of miliseconds given. Can be used to pause script execution in an async scope by invoking the function with await keyword.Promise - Undefined
awaitReplyUtils.awaitReply(message, id, question, limit)Creates a message collector in the channel where message was sent that waits for the first message sent by discord user whos id is equal to id, before starting colector the question is sent in the message's channel. If times out, it returns false otherwise it returns the message collected.Promise - False or Discord Message

Keywords

FAQs

Package last updated on 20 Oct 2019

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