diff --git a/Home.md b/Home.md index 5d08b7b..a5cdd9f 100644 --- a/Home.md +++ b/Home.md @@ -1 +1,293 @@ -Welcome to the Wiki. \ No newline at end of file +## Classes + +
Create the different logging methods for a function +Namespace template = ("[app]:[fileName]:['INFO', 'WARNING', 'DEBUG', 'ERROR']")
+anyAdd the enabled commands to the bot to be used by users in discord +(commands that end in '.mjs' will be enabled, to disable just remove the extension or replace with '.mjs.disabled')
+anyLog the node into the network
+anyDisconnect the client from the server
+anyUpdate node data in the database
+Wrapper to update the systems from the nearbySystems object passed from clients
+string | nullGet the open socket connection ID for a node from the NUID
+ArrayGet all nodes that are connected to a voice channel
+booleanCheck if the given node has an open discord client
+booleanWrapper to check if the given NUID is connected to a VC
+stringGet the discord username from a given socket
+stringGet the discord ID from a given socket
+Request a given socket node to join a given voice channel
+Request a given socket node to leave VC in a given server
+Requset a given socket node to update themselves
+anyUpdate the active RSS feeds and send any new posts to their discord channels
+anyAdd the enabled event listeners to the bot +(events that end in '.mjs' will be enabled, to disable just remove the extension or replace with '.mjs.disabled')
+Write a given message to the log file
+anyDescription
+any
+Add the enabled commands to the bot to be used by users in discord
+(commands that end in '.mjs' will be enabled, to disable just remove the extension or replace with '.mjs.disabled')
+
+**Kind**: global constant
+
+| Param | Type | Default |
+| --- | --- | --- |
+| serverClient | any | |
+| _commandsPath | any | "./commands" |
+
+
+
+## nodeLoginWrapper ⇒ any
+Log the node into the network
+
+**Kind**: global constant
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | object | The data sent from the node |
+| socket | any | The socket the node is connected from |
+
+
+
+## nodeDisconnectWrapper ⇒ any
+Disconnect the client from the server
+
+**Kind**: global constant
+
+| Param | Type | Description |
+| --- | --- | --- |
+| socketId | string | The socket ID that was disconnected |
+
+
+
+## nodeUpdateWrapper ⇒ any
+Update node data in the database
+
+**Kind**: global constant
+
+| Param | Type | Description |
+| --- | --- | --- |
+| nodeData | object | The data object sent from the node |
+
+
+
+## nearbySystemsUpdateWraper
+Wrapper to update the systems from the nearbySystems object passed from clients
+
+**Kind**: global constant
+
+| Param | Type | Description |
+| --- | --- | --- |
+| nuid | string | The NUID of the node that sent the update |
+| nearbySystems | object | The nearby systems object passed from the node to be updated |
+
+
+
+## getSocketIdByNuid ⇒ string \| null
+Get the open socket connection ID for a node from the NUID
+
+**Kind**: global constant
+**Returns**: string \| null - Will return the open socket ID or NULL
+
+| Param | Type | Description |
+| --- | --- | --- |
+| nuid | string | The NUID to find within the open sockets |
+
+
+
+## getAllSocketsConnectedToVC ⇒ Array
+Get all nodes that are connected to a voice channel
+
+**Kind**: global constant
+**Returns**: Array - The sockets connected to VC in a given server
+
+| Param | Type | Description |
+| --- | --- | --- |
+| nodeIo | any | The nodeIo object that contains the IO server |
+| guildId | string | The guild ID string for the guild we are looking in |
+
+
+
+## checkIfNodeHasOpenDiscordClient ⇒ boolean
+Check if the given node has an open discord client
+
+**Kind**: global constant
+**Returns**: boolean - If the given node has an open discord client or not
+
+| Param | Type | Description |
+| --- | --- | --- |
+| openSocket | any | The open socket connection with the node to check |
+
+
+
+## checkIfNodeIsConnectedToVC ⇒ boolean
+Wrapper to check if the given NUID is connected to a VC
+
+**Kind**: global constant
+**Returns**: boolean - If the node is connected to VC in the given server
+
+| Param | Type | Description |
+| --- | --- | --- |
+| nodeIo | any | The nodeIo object that contains the IO server |
+| nuid | string | The NUID string that we would like to find in the open socket connections |
+
+
+
+## getNodeDiscordUsername ⇒ string
+Get the discord username from a given socket
+
+**Kind**: global constant
+**Returns**: string - The username of the bot in the requested server
+
+| Param | Type | Description |
+| --- | --- | --- |
+| socket | any | The socket object of the node to check the username of * @param {string} guildId The guild ID to check the username in |
+
+
+
+## getNodeDiscordID ⇒ string
+Get the discord ID from a given socket
+
+**Kind**: global constant
+**Returns**: string - The ID of the bot
+
+| Param | Type | Description |
+| --- | --- | --- |
+| socket | any | The socket object of the node to check the ID of |
+
+
+
+## requestNodeJoinSystem
+Request a given socket node to join a given voice channel
+
+**Kind**: global constant
+
+| Param | Type | Description |
+| --- | --- | --- |
+| socket | any | The socket object of the node the request should be sent to |
+| systemName | any | The system preset name that we would like to listen to |
+| discordChanelId | string | The Discord channel ID to join the listening bot to |
+
+
+
+## requestBotLeaveServer
+Request a given socket node to leave VC in a given server
+
+**Kind**: global constant
+
+| Param | Type | Description |
+| --- | --- | --- |
+| socket | any | The socket object of the node the request should be sent to |
+| guildId | string | The guild ID to disconnect the socket node from |
+
+
+
+## requestNodeUpdate
+Requset a given socket node to update themselves
+
+**Kind**: global constant
+
+| Param | Type | Description |
+| --- | --- | --- |
+| socket | any | The socket object of the node to request to update |
+
+
+
+## updateFeeds ⇒ any
+Update the active RSS feeds and send any new posts to their discord channels
+
+**Kind**: global constant
+
+| Param | Type | Description |
+| --- | --- | --- |
+| client | any | The discord client to send posts with |
+
+
+
+## addEnabledEventListeners(serverClient, _eventsPath) ⇒ any
+Add the enabled event listeners to the bot
+(events that end in '.mjs' will be enabled, to disable just remove the extension or replace with '.mjs.disabled')
+
+**Kind**: global function
+
+| Param | Type | Default |
+| --- | --- | --- |
+| serverClient | any | |
+| _eventsPath | any | "./events" |
+
+
+
+## writeToLog(logMessage, appName)
+Write a given message to the log file
+
+**Kind**: global function
+
+| Param | Type | Description |
+| --- | --- | --- |
+| logMessage | any | The message to write to the log file |
+| appName | string | The app name that created the log entry |
+
+
+
+## sendNodeCommand(socket, command, data) ⇒ any
+Description
+
+**Kind**: global function
+
+| Param | Type |
+| --- | --- |
+| socket | any |
+| command | any |
+| data | any |
+