my reaction isn't being passed from one script to another.

Passing
client.on(Events.MessageReactionAdd, async (reaction, member) => {
let r = reaction;
let rM = reaction.member;
ruleVerify.execute(client);
});
client.on(Events.MessageReactionAdd, async (reaction, member) => {
let r = reaction;
let rM = reaction.member;
ruleVerify.execute(client);
});
Retrieving
async execute(client) {
let reaction = client.r;
//let member = sessionStorage.getItem("reactionInstanceMember");
console.log(reaction);
}
async execute(client) {
let reaction = client.r;
//let member = sessionStorage.getItem("reactionInstanceMember");
console.log(reaction);
}
11 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
duck
duck2y ago
not exactly sure what you're expecting you defined r not client.r why not just have execute accept the reaction as its param rather than the client?
Snapper
SnapperOP2y ago
I tried that as well, it still came up undefined 😦
duck
duck2y ago
care to share your code for that?
Snapper
SnapperOP2y ago
send
client.on(Events.MessageReactionAdd, async (reaction, member) => {
let r = reaction;
let rM = reaction.member;
ruleVerify.execute(client, r, rM);
});
client.on(Events.MessageReactionAdd, async (reaction, member) => {
let r = reaction;
let rM = reaction.member;
ruleVerify.execute(client, r, rM);
});
retrieve
async execute(client) {
let reaction = r;
//let member = sessionStorage.getItem("reactionInstanceMember");
console.log(reaction);
async execute(client) {
let reaction = r;
//let member = sessionStorage.getItem("reactionInstanceMember");
console.log(reaction);
duck
duck2y ago
I don't see where you defined more than just your client as parameters for execute
Snapper
SnapperOP2y ago
oh in the retrieve?
duck
duck2y ago
it's not as if functions just accept params you don't define
Snapper
SnapperOP2y ago
I thought it was passing from the initial execute in the send @.@
duck
duck2y ago
I'm gonna suggest that you brush up on how functions work before continuing #resources
Snapper
SnapperOP2y ago
x.x thank you I feel dumb haha. appreciate the help though
Want results from more Discord servers?
Add your server