documentation: adjusted docstrings

This commit is contained in:
Aster Fialla
2026-02-24 10:37:02 -05:00
parent 3c7dfcb72b
commit 123aabf650
3 changed files with 28 additions and 29 deletions

View File

@@ -8,7 +8,7 @@ const ih = {};
* *
* @async * @async
* @param {string} authorId - The author of the message * @param {string} authorId - The author of the message
* @param {string | null} attachmentUrl - The attached JSON url. * @param {string | null} [attachmentUrl] - The attached JSON url.
* @returns {string} A successful addition of all members. * @returns {string} A successful addition of all members.
* @throws {Error} When the member exists, or creating a member doesn't work. * @throws {Error} When the member exists, or creating a member doesn't work.
*/ */

View File

@@ -16,12 +16,12 @@ const newAndRemoveCommands = ['new', 'remove'];
* @param {string} authorId - The id of the message author * @param {string} authorId - The id of the message author
* @param {string} authorFull - The username and discriminator of the message author * @param {string} authorFull - The username and discriminator of the message author
* @param {string[]} args - The message arguments * @param {string[]} args - The message arguments
* @param {string | null} attachmentUrl - The attachment URL, if any * @param {string | null} [attachmentUrl] - The attachment URL, if any
* @param {string | null} attachmentExpiration - The attachment expiry date, if any * @param {string | null} [attachmentExpiration] - The attachment expiry date, if any
* @returns {Promise<string>} A success message. * @returns {Promise<string>} A success message.
* @returns {Promise <EmbedBuilder>} A list of 25 members as an embed. * @returns {Promise <EmbedBuilder>} A list of 25 members as an embed.
* @returns {Promise <EmbedBuilder>} A list of member commands and descriptions. * @returns {Promise <EmbedBuilder>} A list of member commands and descriptions.
* @returns {Promise<{EmbedBuilder, [string], string}>} A member info embed + info/errors. * @returns {Promise<{EmbedBuilder, string[], string}>} A member info embed + info/errors.
* @throws {Error} * @throws {Error}
*/ */
mh.parseMemberCommand = async function (authorId, authorFull, args, attachmentUrl = null, attachmentExpiration = null) { mh.parseMemberCommand = async function (authorId, authorFull, args, attachmentUrl = null, attachmentExpiration = null) {
@@ -63,11 +63,11 @@ mh.parseMemberCommand = async function (authorId, authorFull, args, attachmentUr
* @param {string} authorId - The id of the message author * @param {string} authorId - The id of the message author
* @param {string} authorFull - The username and discriminator of the message author * @param {string} authorFull - The username and discriminator of the message author
* @param {boolean} isHelp - Whether this is a help command or not * @param {boolean} isHelp - Whether this is a help command or not
* @param {string | null} command - The command name * @param {string | null} [command] - The command name
* @param {string | null} memberName - The member name * @param {string | null} [memberName] - The member name
* @param {string[]} args - The message arguments * @param {string[]} [args] - The message arguments
* @param {string | null} attachmentUrl - The attachment URL, if any * @param {string | null} [attachmentUrl] - The attachment URL, if any
* @param {string | null} attachmentExpiration - The attachment expiry date, if any * @param {string | null} [attachmentExpiration] - The attachment expiry date, if any
* @returns {Promise<string>} A success message. * @returns {Promise<string>} A success message.
* @returns {Promise <EmbedBuilder>} A list of 25 members as an embed. * @returns {Promise <EmbedBuilder>} A list of 25 members as an embed.
* @returns {Promise <EmbedBuilder>} A list of member commands and descriptions. * @returns {Promise <EmbedBuilder>} A list of member commands and descriptions.
@@ -106,12 +106,11 @@ mh.memberArgumentHandler = async function(authorId, authorFull, isHelp, command
* @async * @async
* @param {string} authorId - The id of the message author * @param {string} authorId - The id of the message author
* @param {string} memberName - The name of the member * @param {string} memberName - The name of the member
* @param {string | null} command - The command being called to query a value. * @param {string | null} [command] - The command being called to query a value.
* @returns {Promise<string>} A success message. * @returns {Promise<string>} A success message.
* @returns {Promise <EmbedBuilder>} A list of 25 members as an embed. * @returns {Promise <EmbedBuilder>} A list of 25 members as an embed.
* @returns {Promise <EmbedBuilder>} A list of member commands and descriptions. * @returns {Promise <EmbedBuilder>} A list of member commands and descriptions.
* @returns {Promise<{EmbedBuilder, [string], string}>} A member info embed + info/errors. * @returns {Promise<{EmbedBuilder, string[], string}>} A member info embed + info/errors.
* @throws {Error}
*/ */
mh.sendCurrentValue = async function(authorId, memberName, command= null) { mh.sendCurrentValue = async function(authorId, memberName, command= null) {
const member = await mh.getMemberByName(authorId, memberName).then((m) => { const member = await mh.getMemberByName(authorId, memberName).then((m) => {
@@ -138,9 +137,8 @@ mh.sendCurrentValue = async function(authorId, memberName, command = null) {
/** /**
* Sends the help text associated with a command. * Sends the help text associated with a command.
* *
* @param {string | null} command - The command being called to query a value. * @param {string} command - The command being called.
* @returns {Promise<string>} A success message. * @returns {string} - The help text associated with a command.
* @returns {string} A list of 25 members as an embed.
*/ */
mh.sendHelpEnum = function(command) { mh.sendHelpEnum = function(command) {
switch (command) { switch (command) {
@@ -167,7 +165,7 @@ mh.sendHelpEnum = function(command) {
* @async * @async
* @param {string} authorId - The id of the message author * @param {string} authorId - The id of the message author
* @param {string} memberName - The name of the member * @param {string} memberName - The name of the member
* @param {string | null} command - The command being called. * @param {string} command - The command being called.
* @param {string[]} values - The values to be passed in. Only includes the values after member name and command name. * @param {string[]} values - The values to be passed in. Only includes the values after member name and command name.
* @param {string | null} attachmentUrl - The attachment URL, if any * @param {string | null} attachmentUrl - The attachment URL, if any
* @param {string | null} attachmentExpiration - The attachment expiry date, if any * @param {string | null} attachmentExpiration - The attachment expiry date, if any
@@ -201,10 +199,10 @@ mh.memberCommandHandler = async function(authorId, command, memberName, values,
* @param {string} authorId - The author of the message * @param {string} authorId - The author of the message
* @param {string} memberName - The member name * @param {string} memberName - The member name
* @param {string[]} values - The arguments following the member name and command * @param {string[]} values - The arguments following the member name and command
* @param {string | null} attachmentUrl - The attachment URL, if any * @param {string | null} [attachmentUrl] - The attachment URL, if any
* @param {string | null} attachmentExpiration - The attachment expiry date, if any * @param {string | null} [attachmentExpiration] - The attachment expiry date, if any
* @returns {Promise<{EmbedBuilder, [string], string}>} A successful addition. * @returns {Promise<{EmbedBuilder, string[], string}>} A successful addition.
* @throws {Error} When the member exists, or creating a member doesn't work. * @throws {Error} When creating a member doesn't work.
*/ */
mh.addNewMember = async function (authorId, memberName, values, attachmentUrl = null, attachmentExpiration = null) { mh.addNewMember = async function (authorId, memberName, values, attachmentUrl = null, attachmentExpiration = null) {
const displayName = values[0]; const displayName = values[0];
@@ -332,10 +330,10 @@ mh.removeMember = async function (authorId, memberName) {
* @async * @async
* @param {string} authorId - The author of the message * @param {string} authorId - The author of the message
* @param {string} memberName - The name of the member. * @param {string} memberName - The name of the member.
* @param {string | null} displayName - The display name of the member. * @param {string | null} [displayName] - The display name of the member.
* @param {string | null} proxy - The proxy tag of the member. * @param {string | null} [proxy] - The proxy tag of the member.
* @param {string | null} propic - The profile picture URL of the member. * @param {string | null} [propic] - The profile picture URL of the member.
* @param {string | null} attachmentExpiration - The profile picture URL of the member. * @param {string | null} [attachmentExpiration] - The expiration date of an uploaded profile picture.
* @returns {Promise<{model, string[]}>} A successful addition object, including errors if there are any. * @returns {Promise<{model, string[]}>} A successful addition object, including errors if there are any.
* @throws {Error} When the member already exists, there are validation errors, or adding a member doesn't work. * @throws {Error} When the member already exists, there are validation errors, or adding a member doesn't work.
*/ */
@@ -406,9 +404,9 @@ mh.addFullMember = async function (authorId, memberName, displayName = null, pro
* @param {string} memberName - The member to update * @param {string} memberName - The member to update
* @param {string} columnName - The column name to update. * @param {string} columnName - The column name to update.
* @param {string} value - The value to update to. * @param {string} value - The value to update to.
* @param {string | null} attachmentExpiration - The attachment expiration date (if any) * @param {string | null} [attachmentExpiration] - The attachment expiration date (if any)
* @returns {Promise<string>} A successful update. * @returns {Promise<string>} A successful update.
* @throws {Error} When the member is not found, or catchall error. * @throws {Error} When no member row was updated.
*/ */
mh.updateMemberField = async function (authorId, memberName, columnName, value, attachmentExpiration = null) { mh.updateMemberField = async function (authorId, memberName, columnName, value, attachmentExpiration = null) {
let fluxerPropicWarning; let fluxerPropicWarning;

View File

@@ -32,11 +32,12 @@ msgh.parseCommandArgs = function(content, commandName) {
/** /**
* Parses messages to see if any part of the text matches the tags of any member belonging to an author. * Parses messages to see if any part of the text matches the tags of any member belonging to an author.
* *
* @async
* @param {string} authorId - The author of the message. * @param {string} authorId - The author of the message.
* @param {string} content - The full message content * @param {string} content - The full message content
* @param {string | null} attachmentUrl - The url for an attachment to the message, if any exists. * @param {string | null} [attachmentUrl] - The url for an attachment to the message, if any exists.
* @returns {{model, string, bool}} The proxy message object. * @returns {{model, string, bool}} The proxy message object.
* @throws {Error} If a proxy message is sent with no message within it. * @throws {Error} If a proxy message is sent with no message or attachment within it.
*/ */
msgh.parseProxyTags = async function (authorId, content, attachmentUrl = null){ msgh.parseProxyTags = async function (authorId, content, attachmentUrl = null){
const members = await memberHelper.getMembersByAuthor(authorId); const members = await memberHelper.getMembersByAuthor(authorId);