Members
CurrEnvValues
The enum for the environment, the valid values are TESTING, PRODUCTION, and PRODUCTION_DOCKER
- Source:
Methods
(async) flattenMarkdown(string, guild) → {Promise.<string>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
string |
string
|
The string to flatten markdown |
guild |
Discord.Guild
|
The Discord guild to fetch property managers from |
Returns:
- Type:
-
Promise.<string>
The flattened markdown string
formatPunishmentTime(length, bareopt) → {string}
Formats a punishment time to a human readable format
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
length |
number
|
the length of the punishment |
|
bare |
boolean
|
<optional> |
false by default, whether to return the time in a bare format (without suffix) |
Returns:
- Type:
-
string
The formatted punishment time
formatTimestamp(date, format)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
date |
Date
|
number
|
The date to format, can be a number in milliseconds or a Date object |
format |
"d"
|
"D"
|
"f"
|
"F"
|
"R"
|
"t"
|
"T"
|
"f" by default, see below for more info Available formats:
|
hexToNum(hexCode) → {number}
Converts a hex color to base-10
- Source:
Parameters:
Name | Type | Description |
---|---|---|
hexCode |
string
|
the hex code to convert |
Returns:
- Type:
-
number
The hex value in base-10
hexToRGB(hexCode) → {Array.<number>}
Converts a hex color to rgb
- Source:
Parameters:
Name | Type | Description |
---|---|---|
hexCode |
string
|
the hex code to convert |
Returns:
- Type:
-
Array.<number>
The RGB values of the hex code, lenght 3
humanizeArray(array, codeopt, conjunctionopt, commaopt) → {string}
Make an array human readable
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
array |
Array.<unknown>
|
The array to humanize |
|
code |
boolean
|
<optional> |
Whether to return the in code blocks, true by default |
conjunction |
string
|
<optional> |
The conjunction to use for the final list element, "and" by default |
comma |
string
|
<optional> |
The comma to use for the element seperation, "," by default |
Returns:
- Type:
-
string
The humainized array
humanizeConstant(name, uppercaseExceptionsopt, lowercaseExceptionsopt) → {string}
Make a constant human readable
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string
|
The constant to humainize |
|
uppercaseExceptions |
string
|
<optional> |
Optional, a list of words to uppercase as is |
lowercaseExceptions |
string
|
<optional> |
Optional, a list of words to lowercase as is |
Returns:
- Type:
-
string
The humainized constant
isURL(input) → {boolean}
Check if a string is a valid URL
Parameters:
Name | Type | Description |
---|---|---|
input |
string
|
The input to check |
Returns:
- Type:
-
boolean
whether the input is a valid URL
(async) loadDir(dir, processopt, baseCollectionopt) → {Promise.<Discord.Collection.<string, T>>}
Loads a directory of files and returns an collection of the files code contents
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
dir |
string
|
The directory to load |
|
process |
function
|
<optional> |
The function to process each file |
baseCollection |
Discord.Collection.<string, T>
|
<optional> |
The base collection to add the files to |
Returns:
- Type:
-
Promise.<Discord.Collection.<string, T>>
The collection of files This is a generic loadDir, the one in main bot supercedes it For main bot use, use the one in main bot
(async) loadJSON5(filename) → {Promise.<any>}
Loads a json5 file asyncronously
- Source:
Parameters:
Name | Type | Description |
---|---|---|
filename |
string
|
The file to load |
Returns:
- Type:
-
Promise.<any>
The loaded file
loadSyncJSON5(filename) → {any}
Loads a json5 file syncronously
- Source:
Parameters:
Name | Type | Description |
---|---|---|
filename |
string
|
The file to load |
Returns:
- Type:
-
any
The loaded file
noop(…_unused) → {null}
A no-operation function
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
_unused |
Array.<unknown>
|
<repeatable> |
This parameter is not used, it is a NO-OP function |
Returns:
- Type:
-
null
Always returns null
pastTense(verb) → {string}
Inflects a verb into past tense
- Source:
Parameters:
Name | Type | Description |
---|---|---|
verb |
string
|
The verb to inflict in past tense |
Returns:
- Type:
-
string
The verb in past tense
pluralize(word, countopt, inclusiveopt) → {string}
Pluralize or singularize a word based on the passed in count.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
word |
string
|
The word to change the plural of |
|
count |
number
|
<optional> |
How many objects are we talking about?, optional |
inclusive |
boolean
|
<optional> |
Whether to include the number in the pluralized word, optional |
Returns:
- Type:
-
string
The pluralized word
quote(text) → {string}
Quote a text in markdown
Parameters:
Name | Type | Description |
---|---|---|
text |
string
|
The text to quote |
Returns:
- Type:
-
string
The quoted text
(async) replaceAsync(string, searchValue, replacer) → {Promise.<string>}
Replaces a string with a value asynchronously
- Source:
Parameters:
Name | Type | Description |
---|---|---|
string |
string
|
The string to search and replace in |
searchValue |
string
|
RegExp
|
The value to search for |
replacer |
function
|
string
|
The function to process each match, or replacement string |
Returns:
- Type:
-
Promise.<string>
The replaced string
stringifyAnything(thing, indentopt, depthopt, currentDepthopt) → {string}
Stringifies literally anything
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
thing |
unknown
|
The thing to stringify |
|
indent |
number
|
<optional> |
The indent depth, 0 by default |
depth |
number
|
<optional> |
The space depth, 0 by default |
currentDepth |
number
|
<optional> |
The total depth offset to base other depths off of, 0 by default |
Returns:
- Type:
-
string
Your weirdest thing, stringified
trimSides(text, startTrim, endTrim) → {string}
A lodash macro to trim the sides of a string
- Source:
Parameters:
Name | Type | Description |
---|---|---|
text |
string
|
The text to trim |
startTrim |
string
|
The string to trim from the start |
endTrim |
string
|
The string to trim from the end |
Returns:
- Type:
-
string
The trimmed text
truncateString(string, length, ellipsisopt) → {string}
Truncate a string to a certain length
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
string |
string
|
The string to truncate |
|
length |
number
|
The length of the truncated string |
|
ellipsis |
string
|
<optional> |
The ellipsis to use, "..." by default |
Returns:
- Type:
-
string
The truncated string