UtilService - shysolocup/noscord.js GitHub Wiki
service class for general utilities such as
|
|
JS | |
const { Client } = require('noscord.js');
const client = new Client();
client.import("util");
client.on("ready", async () =>
util.random.int(1, 5); // 2
util.random.choice([ "a", "b", "c"]); // "c"
await util.sleep("1s");
util.parse("1m"); // 60
util.parseMs("1m"); // 60000
util.colors.blurple; // "#7289da"
util.genCode(9); // "ij7elwolz"
let ts = new Timestamp();
console.log(ts.relative); // "<t:1543392060:R>"
}); |