Skip to content

Commit

Permalink
Added $getMentions
Browse files Browse the repository at this point in the history
  • Loading branch information
Leref committed Dec 3, 2023
1 parent f2fafc7 commit 7e3136f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/functions/util/getMentions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = d => {
const data = d.util.aoiFunc(d);
const [type = "users", sep = ", "] = data.inside.splits;

const mentions = d.mentions;
let result = ""
switch (type) {
case 'users':
result = mentions.users.map(u => u.id).join(sep);
break;
case 'roles':
result = mentions.roles.map(r => r.id).join(sep);
break;
default:
break;
}

data.result = result

return {
code: d.util.setCode(data),
};
}

0 comments on commit 7e3136f

Please sign in to comment.