Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
action(bot, msg, suffix, monochrome) {
if (!suffix) {
const { prefix } = msg;
return throwPublicErrorInfo('Kanji', `Say **${prefix}kanji [kanji]** to search for kanji. For example: **${prefix}kanji 瞬間**. Say **${prefix}help kanji** for more help.`, 'No suffix');
}
const { navigationChapter, pageCount } = createKanjiNavigationChapter(
suffix,
msg.author.username,
msg.prefix,
false,
);
const navigation = Navigation.fromOneNavigationChapter(
msg.author.id,
navigationChapter,
pageCount > 1,
);
return monochrome.getNavigationManager().show(
navigation,
constants.NAVIGATION_EXPIRATION_TIME,
msg.channel,
msg,
);
},
};
action(bot, msg, suffix, monochrome) {
if (!suffix) {
const { prefix } = msg;
return throwPublicErrorInfo('Stroke Order Search', `Say **${prefix}strokeorder [kanji]** to search for stroke order information. For example: **${prefix}strokeorder 瞬間**. Say **${prefix}help strokeorder** for more help.`, 'No suffix');
}
const { navigationChapter, pageCount } = createStrokeOrderNavigationChapter(
suffix,
msg.author.username,
false,
);
const navigation = Navigation.fromOneNavigationChapter(
msg.author.id,
navigationChapter,
pageCount > 1,
);
return monochrome.getNavigationManager().show(
navigation,
constants.NAVIGATION_EXPIRATION_TIME,
msg.channel,
msg,
);
},
};
throw err;
}
const numUsers = await scoreQuery.countUsers();
const showArrows = numUsers > MAX_SCORERS_PER_PAGE;
const navigationDataSource = new ScoresDataSource(
deckNamesArray,
isGlobal,
scoreQuery,
msg,
);
const navigationChapter = new NavigationChapter(navigationDataSource);
const navigation = Navigation.fromOneNavigationChapter(
msg.author.id,
navigationChapter,
showArrows,
);
return monochrome.getNavigationManager().show(
navigation,
constants.NAVIGATION_EXPIRATION_TIME,
msg.channel,
msg,
);
},
};