Skip to content

functions

oof2win2 edited this page Sep 9, 2021 · 4 revisions

Functions

bubbleSort(arr)Array

Sorts an array with BubbleSort. Tested with strings and numbers.

getServerFromChannelInput(channelID)object | null
runShellCommand(cmd)childprocess.stdout | childprocess.stderr

Run a shell command. Returns only after the command is finished. DOesn't allow for extra specifications

sortModifiedDate(pathArr)Array.<Object>

Sort a directory's contents by date modified

createPagedEmbed(fields, embedMsgOptions, options, maxPageCount)
checkBan(playername)

Check whether or not a player is on the banlist

addban(playername, reason)

Add a player to the banlist

removeban(playername)

Remove a player from the banlist

bubbleSort(arr) ⇒ Array

Sorts an array with BubbleSort. Tested with strings and numbers.

Kind: global function
Returns: Array - Sorted array

Param Type Description
arr Array Unsorted array

getServerFromChannelInput(channelID) ⇒ object | null

Kind: global function
Returns: object | null - A server object from the servers.js file

Param Type Description
channelID discord.Snowflake ID of the Discord channel that you are trying to get

runShellCommand(cmd) ⇒ childprocess.stdout | childprocess.stderr

Run a shell command. Returns only after the command is finished. DOesn't allow for extra specifications

Kind: global function

Param Type Description
cmd string Shell command to run

sortModifiedDate(pathArr) ⇒ Array.<Object>

Sort a directory's contents by date modified

Kind: global function
Returns: Array.<Object> - Array of path objects, sorted by last modified. has path and mtime (modified time)

Param Type Description
pathArr Array.<string> Path to the directory you want to get files from and sort by modified date

createPagedEmbed(fields, embedMsgOptions, options, maxPageCount)

Kind: global function

Param Type Description
fields Array
embedMsgOptions object Standard
options object
maxPageCount options.maxPageCount maximum number of things on the page

checkBan(playername)

Check whether or not a player is on the banlist

Kind: global function

Param Type
playername String

addban(playername, reason)

Add a player to the banlist

Kind: global function

Param Type
playername String
reason String

removeban(playername)

Remove a player from the banlist

Kind: global function

Param Type
playername String