The Wayback Machine - https://web.archive.org/web/20210917222118/https://github.com/topics/discordjs
Skip to content
#

discordjs

discord-js logo

Discord.JS is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other libraries, making your bot's code significantly tidier and easier to comprehend.

Here are 1,575 public repositories matching this topic...

JohnScience
JohnScience commented Aug 10, 2018

The most of Discord bots are expected to provide "mute" and "ban" commands. Their implementation involves juggling with parsing strings just to get so-much-desired duration.

Formats:

"3w 1d 11 [many spaces]h \t30m 20s 5ms"

Methods:

  • duration.toWeeks() -> float
  • duration.toDays() -> float
  • duration.toMinutes() -> float
  • duration.toSeconds() -> float
  • duration.toMilliseconds()