Skip to content

Commit

Permalink
fix: add "suhu" alias to dukun's getCommandArgs (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
krowter authored Feb 15, 2024
1 parent 4edd2c9 commit ee1cd68
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit ee1cd68

Please sign in to comment.