Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
description: `Say **${prefixedHelpCommand} CommandNameHere** to see more information about a specific command.`,
author: {
name: `${EMBED_TITLE} (page ${pageNumber} of ${numPages})`,
icon_url: EMBED_ICON_URI,
url: WEB_COMMANDS_URI,
},
url: WEB_COMMANDS_URI,
fields,
color: EMBED_COLOR,
footer,
};
pages.push({ embed });
}
return Navigation.fromOneDimensionalContents(commandMessage.author.id, pages);
}
function createScoresNavigation(monochrome, msg, scoresPages) {
const contents = scoresPages.map(page => createDiscordContentForScoresPage(page));
const navigation = Navigation.fromOneDimensionalContents(msg.author.id, contents);
return monochrome.getNavigationManager().show(navigation, 1800000, msg.channel, msg);
}
if (!suffix) {
const { prefix } = msg;
return throwPublicErrorInfo('Español', `Usa ${prefix}español [palabra] para buscar una palabra. Por ejemplo: ${prefix}español 瞬間`, 'No suffix');
}
const hispadicIndex = await awaitHispadicIndex;
const allResults = hispadicIndex.search(suffix, MAX_RESULTS);
const qualityResults = allResults.filter(r => r.matchType > 1);
const results = qualityResults.length > 0 ? qualityResults : allResults;
if (results.length === 0) {
return throwPublicErrorInfo('Español', `No encontré ningún resultado para **${suffix}**.`, 'No results');
}
const contents = createNavigationContents(results, suffix, msg.author.username);
const navigation = Navigation.fromOneDimensionalContents(msg.author.id, contents);
return monochrome.getNavigationManager().show(
navigation,
constants.NAVIGATION_EXPIRATION_TIME,
msg.channel,
msg,
);
},
};
async function createNavigationForAnime(authorName, authorId, keyword) {
const searchResults = await searchAnime(keyword);
if (searchResults.length === 0) {
return throwPublicErrorInfo('Kitsu Anime Search', `I didn't find any results for **${keyword}**.`, 'No results');
}
const discordContent = formatAnimeData(searchResults, authorName);
const navigation = Navigation.fromOneDimensionalContents(authorId, discordContent);
return navigation;
}
async function createNavigationForAnime(authorName, authorId, keyword, msg, navigationManager) {
const searchResults = await searchAnime(keyword);
if (searchResults.length === 0) {
return throwPublicErrorInfo('Kitsu Anime Search', `I didn't find any results for **${keyword}**.`, 'No results');
}
const discordContent = formatAnimeData(searchResults, authorName);
const navigation = Navigation.fromOneDimensionalContents(authorId, discordContent);
return navigationManager.show(navigation, constants.NAVIGATION_EXPIRATION_TIME, msg.channel, msg);
}
const commandInvokersRow = sortedScores[commandInvokersIndex];
if (commandInvokersIndex < elementStartIndex || commandInvokersIndex > elementEndIndex) {
content.embed.fields.push(createFieldForScorer(
commandInvokersIndex,
commandInvokersRow.username,
commandInvokersRow.score,
));
}
}
navigationContents.push(content);
}
const authorId = msg.author.id;
const navigation = Navigation.fromOneDimensionalContents(authorId, navigationContents);
return navigationManager.show(navigation, constants.NAVIGATION_EXPIRATION_TIME, msg.channel, msg);
}
description: `Say **${prefixedHelpCommand} CommandNameHere** to see more information about a specific command.`,
author: {
name: `${EMBED_TITLE} (page ${pageNumber} of ${numPages})`,
icon_url: EMBED_ICON_URI,
url: WEB_COMMANDS_URI,
},
url: WEB_COMMANDS_URI,
fields,
color: EMBED_COLOR,
footer,
};
pages.push({ embed });
}
return Navigation.fromOneDimensionalContents(commandMessage.author.id, pages);
}
function createScoresNavigation(monochrome, msg, scoresPages) {
const contents = scoresPages.map(page => createDiscordContentForScoresPage(page));
const navigation = Navigation.fromOneDimensionalContents(msg.author.id, contents);
return monochrome.getNavigationManager().show(navigation, 1800000, msg.channel, msg);
}