i need help

so basically i wanna know how to make it so it reacts to a specific user with a specific emoji
21 Replies
d.js toolkit
d.js toolkit4w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
#100 dapro
#100 daproOP4w ago
I react with my message So like when i type !ar (user) 💀 Everytime i type something I automatically react to that specific user with that specific emoji
Retro
Retro4w ago
You can't react unless there's a message to react to
#100 dapro
#100 daproOP4w ago
I know bro I said Everytime I send Or the specific User send something I automatically react to that message With the specific emoji
Retro
Retro4w ago
Use a messageCreate listener to monitor the messages and react
#100 dapro
#100 daproOP4w ago
What the command for it
Retro
Retro4w ago
?
#100 dapro
#100 daproOP4w ago
Like How do i do it Iam new bro sorry
d.js docs
d.js docs4w ago
:method: Message#react() [email protected] Adds a reaction to the message.
// React to a message with a unicode emoji
message.react('🤔')
.then(console.log)
.catch(console.error);
// React to a message with a unicode emoji
message.react('🤔')
.then(console.log)
.catch(console.error);
Retro
Retro4w ago
No worries but this will involve some database and stuff so you do need a good foundation in javascriptb
#100 dapro
#100 daproOP4w ago
So when i type for example “!ar (user) (emoji)” it will react to that specific user with the emoji mentioned? Ah Alr Thank you
Retro
Retro4w ago
No you will need to implement that yourself but this is how to react to a message
#100 dapro
#100 daproOP4w ago
I have my friends code but i wanna make my own(he found it on chatgpt) Wait lemme send it const activeReactions = new Map(); module.exports = { run: async (client, message, args) => { // Permission check: Only the bot owner can execute this command if (message.author.id !== client.user.id) return; // Check for arguments if (args.length < 1) { return message.reply( "Use the command as follows:\nStart: .ar <UserID> <Emoji1>,<Emoji2>,...\nStop: .ar stop <UserID>" ); } // Check if the command is "stop" if (args[0].toLowerCase() === "stop") { const targetUserId = args[1]; // ID of the user to stop the feature for if (!targetUserId || !activeReactions.has(targetUserId)) { return message.reply("No active AutoReact found for this user."); } activeReactions.delete(targetUserId); // Disable reactions return message.reply( Automatic reactions for user with ID ${targetUserId} have been disabled. ); } // Extract UserID and emoji list const targetUserId = args[0]; // ID of the target user const emojis = args.slice(1).join(" ").split(","); // Split emojis if (emojis.length === 0) { return message.reply("Please provide at least one emoji."); } // Update the map: Link user ID with emojis activeReactions.set(targetUserId, emojis); // Enable event listener client.on("messageCreate", (msg) => { if (!activeReactions.has(msg.author.id)) return; // No active reaction for this user if (msg.author.id === targetUserId && !msg.author.bot) { const emojis = activeReactions.get(targetUserId); // Retrieve emojis const randomEmoji = emojis[Math.floor(Math.random() * emojis.length)]; // Pick a random emoji msg.react(randomEmoji).catch((error) => console.error("Error adding reaction:", error) ); } }); message.reply( Automatic reactions for user with ID ${targetUserId} have been activated.\nEmojis: ${emojis.join( ", " )} ); }, }; Here I wanna make my own
Retro
Retro4w ago
If you're a beginner, I recommend reading the guide and https://discordjs.guide
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
#100 dapro
#100 daproOP4w ago
Thank you but you do know iam talking about selfbots?
Retro
Retro4w ago
Kindly leave then. We don't support that here.
#100 dapro
#100 daproOP4w ago
Why is that the case
Retro
Retro4w ago
Go read the discord tos
#100 dapro
#100 daproOP4w ago
Wait a sec Is it illegal???
Retro
Retro4w ago
Yes
#100 dapro
#100 daproOP4w ago
Fuck Am so sorry I didnt know Thank you so much for telling me Thank you for giving me your time

Did you find this page helpful?