🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

dbd.js-utils

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbd.js-utils

A simple Utility that will help dbd.js users develop their bot

npmnpm
Version
0.0.2
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

dbd.js-utils

An extra Utility that will develop dbd.js bots more easier

What does it do?

  • Formatting Dates
  • Progress Bars for Music and Others
  • ms-parser and parse-ms in one
  • Timeago Possibility

Methods

  • parseToMS(string) - Convert Duration in String to MS (Same as ms-parser) Example
parseToMS("3d10m3M") // can be declared as 3 Months, 3 days, 10 Minutes
  • parseMS(ms) - Convert MS to Durations (seconds, minutes, hours, days, months, years) (More possibilities than parse-ms) Example
parseMS(345840000) // 3 and 1 Days, 4 minutes 

Output

{
  second:0,
  minute:4,
  hour:0,
  day:4,
  month:0,
  year:0
}
  • progressBar(SubstractSeconds, maxSeconds, AmountOfBars, addMarker, FilledSymbol, UnfilledSymbol) - Creates a Progress bar based on given data

Logic of command

maxSeconds will be divided by AmountOfBars to create the divider, then SubstractSeconds will subtract maxSeconds and will be divided by divider, the results will create a Filled Bar marked with FilledSymbol, if addMarker is given, it will add it to the end of Filled Bar, then the amount of Filled Bar will substract AmountOfBars to get the Unfilled bars that will be filled with UnfilledSymbol. Example

progressBar(102, 315, 10, "📀", "―", "―")

Output

――――📀―――――
  • formatDate(datestamp / date in ms, format, timezone) - Convert datestamp to Date and Format it Example
formatDate(1613374163494, "day, dd mmm yyyy", "UTC")

Output

Monday, 15 Feb 2021

List of Formats

FormatDescriptionOutput
YYYYGets the Full Year of date2021
YYGets the last 2 digits of Full Year21
DDDGets the Abbreviation of Day of the WeekMon
DAYGets the Name of Day of the WeekMonday
DDGets the Day Date in Month of date15
DGets the Number Day of the Week2
MMMGets the Month AbbreviationFeb
MONTHGets the Month Name of dateFebruary
MMGets the Month of date2
HOURGets the Amount of Hour of date7
MINGets the Amount of Minutes of date37
SECGets the Amount of Seconds of date37

License

See MIT License for License

FAQs

Package last updated on 16 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts