const { Listener } = require('discord-akairo');

class MessageReactionAddListener extends Listener {
	constructor() {
		super('messageReactionAdd', {
			eventName: 'messageReactionAdd',
			emitter: 'client',
			category: 'client'
		});
	}

	async exec(reaction, user) {
		if (reaction.emoji.name === '⭐') {
			const starboard = this.client.starboards.get(reaction.message.guild.id);
			const error = await starboard.add(reaction.message, user);
			if (error) {
				reaction.message.channel.send(`${user}, ${error.message}`);
			}
		}
	}
}

module.exports = MessageReactionAddListener;

const { Listener } = require('discord-akairo');

class MessageReactionAddListener extends Listener {
	constructor() {
		super('messageReactionAdd', {
			eventName: 'messageReactionAdd',
			emitter: 'client',
			category: 'client'
		});
	}

	async exec(reaction, user) {
		if (reaction.emoji.name === '⭐') {
			const starboard = this.client.starboards.get(reaction.message.guild.id);
			const error = await starboard.add(reaction.message, user);
			if (error) {
				reaction.remove(user);
				reaction.message.channel.send(`${user}, ${error.message}`);
			}
		}
	}
}

module.exports = MessageReactionAddListener;

Remove reaction if there is some error
Remove reaction if there is some error

