Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add "suhu" alias to dukun's getCommandArgs #223

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/services/dukun/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function fetchUpstream(dukunModel, cache, updatedData) {
* @param {import('@teknologi-umum/nedb-promises')} cache
* @returns {Promise<void>}
*/
async function dukun(context, mongo, cache) {
async function dukun(context, mongo, cache, cmd) {
// Reject private and channels
if (
context.message.chat.type === "private" ||
Expand All @@ -79,7 +79,7 @@ async function dukun(context, mongo, cache) {
return;
}

const argument = getCommandArgs("dukun", context);
const argument = getCommandArgs(cmd, context);

const Dukun = mongo.model("Dukun", dukunSchema, "dukun");
const dukunData = await cache.findOne({ key: "dukun:all" });
Expand Down Expand Up @@ -281,8 +281,8 @@ async function dukun(context, mongo, cache) {
* @returns {{command: String, description: String}[]}
*/
export function register(bot, mongo, cache) {
bot.command("dukun", (context) => dukun(context, mongo, cache));
bot.command("suhu", (context) => dukun(context, mongo, cache));
bot.command("dukun", (context) => dukun(context, mongo, cache, "dukun"));
bot.command("suhu", (context) => dukun(context, mongo, cache, "suhu"));

return [
{
Expand Down
Loading