UNPKG

bot-utils

Version:

JavaScript program and Discord Bot development tools

51 lines (37 loc) 3.84 kB
<p align="center"> <img src="https://legacy.axelgreavette.xyz/v2/img/portfolio/botutils.png"> </p> # Bot-Utils [![NPM](https://nodei.co/npm/bot-utils.png?)](https://nodei.co/npm/bot-utils/) [![npm version](https://badge.fury.io/js/bot-utils.svg)](https://badge.fury.io/js/bot-utils) [![Downloads](https://img.shields.io/npm/dt/bot-utils.svg?maxAge=3600)](https://www.npmjs.com/package/bot-utils) [![CircleCI](https://circleci.com/gh/axelgreavette/bot-utils.svg?style=shield)](https://circleci.com/gh/axelgreavette/bot-utils) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors) Easy to use utilities for JavaScript written Discord bots. Or you can use them any Javascript program... ~~For the version using classes visit [here](https://github.com/axelgreavette/bot-utils/tree/classes)~~ Don't do this right now... It's way behind and not working correctly. ## Contributing If you wish to contribute to **bot-utils** continued development make sure to take a look at [this](https://github.com/axelgreavette/bot-utils/blob/master/CONTRIBUTING.md) file. ## Method Documentation | Method | Extends | Description | |--|--|--| |`Array.shuffle()` | Array | Shuffles the attached `array` | |`Array.random()` | Array | Picks a random item from the attached `array`| |`Object.isArray()` | Object | Returns whether or not the attached `object` is actually an `array` | |`snowflake(snowflake)`| N/A |Returns the date of given `snowflake` | |`cpuUsage()` | N/A |Returns the CPU usage for the time when it was called | |`randColor()`| N/A |Returns a random `#` prefixed Hex colour code | |`randInt(min, max)`| N/A |Returns a random integer from a range of `mid` to `max` | |`randAlphaNum(len)` | N/A |Returns a random alphanumeric | |`round(number, decimal-place)` | N/A |Returns a the given `number` rounded to the given `decimal-place` | |`hasNumber(string)` | N/A |Returns a boolean based on whether the supplied string contains a number or not | |`isNumber(input)` | N/A |Returns a boolean based on whether the supplied input is a number or not | |`uptime()` | N/A |Returns process uptime formatted into a human readable string | ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore --> <table> <tr> <td align="center"><a href="https://axelg.xyz"><img src="https://avatars1.githubusercontent.com/u/31705527?v=4" width="100px;" alt="Axel Greavette"/><br /><sub><b>Axel Greavette</b></sub></a><br /><a href="#infra-axelgreavette" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/axelgreavette/bot-utils/commits?author=axelgreavette" title="Tests">⚠️</a> <a href="https://github.com/axelgreavette/bot-utils/commits?author=axelgreavette" title="Documentation">📖</a> <a href="https://github.com/axelgreavette/bot-utils/commits?author=axelgreavette" title="Code">💻</a></td> <td align="center"><a href="https://github.com/jerskisnow"><img src="https://avatars0.githubusercontent.com/u/29165327?v=4" width="100px;" alt="jerskisnow"/><br /><sub><b>jerskisnow</b></sub></a><br /><a href="https://github.com/axelgreavette/bot-utils/commits?author=jerskisnow" title="Code">💻</a> <a href="https://github.com/axelgreavette/bot-utils/commits?author=jerskisnow" title="Documentation">📖</a></td> </tr> </table> <!-- ALL-CONTRIBUTORS-LIST:END --> This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!