Skip to content

Commit

Permalink
newusers: Fix JSDoc for async functions.
Browse files Browse the repository at this point in the history
Any async function necessarily returns a Promise.
  • Loading branch information
KockaAdmiralac committed Sep 19, 2023
1 parent 268186c commit 16757bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/newusers/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class ReportsChannel {
* @param {number|string} user ID or username of the Fandom user being
* classified
* @param {string} classifierId Discord user ID of the classifying user
* @returns {Promise} Result of the insert operation
* @returns {Promise<any>} Result of the insert operation
*/
#updateClassification(isSpam, user, classifierId) {
const query = typeof user === 'string' ?
Expand All @@ -405,7 +405,7 @@ class ReportsChannel {
* Classifies all unclassified profiles as spam or not spam.
* @param {boolean} isSpam Whether the profile is spam
* @param {string} classifierId Discord ID of the classifying user
* @returns {Promise} Result of the insert operation
* @returns {Promise<any>} Result of the insert operation
*/
#updateClassificationAll(isSpam, classifierId) {
return this.#db.execute(UPDATE_ALL_PROFILES, [
Expand Down
2 changes: 1 addition & 1 deletion modules/newusers/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function setupCommands() {

/**
* Sets up an application-owned webhook.
* @returns {object} Webhook information
* @returns {Promise<object>} Webhook information
*/
async function setupWebhook() {
const url = new URL('https://discord.com/api/oauth2/authorize');
Expand Down
4 changes: 2 additions & 2 deletions modules/newusers/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function isReportable(userData) {
* Can only get 50 users due to API restrictions.
* @param {import('../../include/io.js')} io API client
* @param {string[]} usernames Usernames whose data should be retrieved
* @returns {number[]} User IDs of requested users
* @returns {Promise<number[]>} User IDs of requested users
*/
async function getIds(io, usernames) {
const {query} = await io.query('community', 'en', 'fandom.com', {
Expand All @@ -36,7 +36,7 @@ async function getIds(io, usernames) {
* Retrieves user data about users with specified usernames from the API.
* @param {import('../../include/io.js')} io API client
* @param {string[]} usernames Usernames whose data should be retrieved
* @returns {object[]} User data
* @returns {Promise<object[]>} User data
*/
async function getUserData(io, usernames) {
const usernamesLeft = Array.from(usernames);
Expand Down

0 comments on commit 16757bd

Please sign in to comment.