Skip to content

UtilService

github-actions[bot] edited this page Sep 30, 2024 · 6 revisions

service class for general utilities such as

  • randomization
  • code generation
  • timestamp creation
  • colors

AeplSubClass

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>"
});


πŸ›ˆ Client

πŸ›ˆ AddonService

πŸ›ˆ AttachmentService

πŸ›ˆ ChannelService

πŸ›ˆ CommandService

πŸ›ˆ ComponentService

πŸ›ˆ ErrorService

πŸ›ˆ EventService

πŸ›ˆ ExpressionService

πŸ›ˆ GuildService

πŸ›ˆ LogService

πŸ›ˆ MessageService

πŸ›ˆ PermissionService

πŸ›ˆ RoleService

πŸ›ˆ StorageService

πŸ›ˆ TypeService

πŸ›ˆ UserService

πŸ›ˆ UtilService

πŸ›ˆ VoiceService


Clone this wiki locally