📄
Advanced-Command-Handler Guide
  • Home
  • Concepts
    • CommandHandler
    • Commands
      • Commands Templates
      • CommandContext
      • SubCommands
    • Events
  • Default Commands & Events
  • Utilities
    • BetterEmbed & Embed Templates
    • Logger
    • Miscellaneous
  • v2 to v3 Migration Guide
  • Discord Support
  • Documentation
  • GitHub
Powered by GitBook
On this page
  • Errors
  • Arguments
  • JSON Utilities
  • Permissions
  • Other

Was this helpful?

  1. Utilities

Miscellaneous

PreviousLoggerNextv2 to v3 Migration Guide

Last updated 3 years ago

Was this helpful?

There are many useful functions that can be used in many places to avoid duplicating code, you can see a list here :

Errors

  • : Send an argument error.

  • : Send an internal error.

  • : Send a permission error.

Arguments

  • : Get easily arguments of a given type.

JSON Utilities

  • : Saves a JSON safely, returning a boolean meaning if it worked.

  • : Reads a JSON, prefer using import or require.

Permissions

  • : Returns true if the given ID is included in the owners set in .

  • : Returns true if the given string is a valid permission. It's also a type guard for PermissionString type for TypeScript users.

Other

: Cut a text at a given length (if too long).

: Get a key from a value in an object.

: Returns a random value from an array.

argError
codeError
permissionsError
getThing
saveJSON
readJSON
isOwner
CommandHandler.create
isPermission
cutIfTooLong
getKeyByValue
random