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 toolkit•3y 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
duck•3y 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
SnapperOP•3y ago
I tried that as well, it still came up undefined 😦
duck
duck•3y ago
care to share your code for that?
Snapper
SnapperOP•3y 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
duck•3y ago
I don't see where you defined more than just your client as parameters for execute
Snapper
SnapperOP•3y ago
oh in the retrieve?
duck
duck•3y ago
it's not as if functions just accept params you don't define
Snapper
SnapperOP•3y ago
I thought it was passing from the initial execute in the send @.@
duck
duck•3y ago
I'm gonna suggest that you brush up on how functions work before continuing #resources
Snapper
SnapperOP•3y ago
x.x thank you I feel dumb haha. appreciate the help though

Did you find this page helpful?