YordiGamex
YordiGamex
DIAdiscord.js - Imagine an app
Created by YordiGamex on 9/4/2024 in #djs-questions
recognize user
I want to make a command that reads all the arguments given to a user with a keyboard and looks for which of those messages are IDs of existing people, and if it finds them, it returns all the ones it found in the form of a mention. I have this code:
(async () => {
const args = d.message.content.split(" ").slice(1);
const validIds = [];

for (const id of args) {
try {
await client.users.fetch(id);
validIds.push(id);
} catch {
}
}

if (validIds.length > 0) {
return validIds.join("\\n");
}
})()
(async () => {
const args = d.message.content.split(" ").slice(1);
const validIds = [];

for (const id of args) {
try {
await client.users.fetch(id);
validIds.push(id);
} catch {
}
}

if (validIds.length > 0) {
return validIds.join("\\n");
}
})()
but it doesn't work
7 replies