nexxel
nexxel
Explore posts from servers
SIASapphire - Imagine a framework
Created by nexxel on 3/18/2023 in #sapphire-support
How do I listen for reactions on all messages in a channel?
doing discord bot dev after a long time. i wanted to listen for message reactions on every message in a channel and run a db query in the run function. but for some reason i can't even get a simple log to work rn. what am i doing wrong here?
// src/listeners/reaction.ts

import { ApplyOptions } from "@sapphire/decorators";
import { Events, Listener } from "@sapphire/framework";

@ApplyOptions<Listener.Options>({
event: Events.MessageReactionAdd,
enabled: true,
once: false,
name: "reaction",
})
export class UserEvent extends Listener {
public async run() {
const { logger } = this.container;
logger.info("Reaction added");
}
}
// src/listeners/reaction.ts

import { ApplyOptions } from "@sapphire/decorators";
import { Events, Listener } from "@sapphire/framework";

@ApplyOptions<Listener.Options>({
event: Events.MessageReactionAdd,
enabled: true,
once: false,
name: "reaction",
})
export class UserEvent extends Listener {
public async run() {
const { logger } = this.container;
logger.info("Reaction added");
}
}
16 replies