Are you interested in a contribution for adding Reaction bots to Akairo?
See original GitHub issueI have a basic implementation of a ReactionHandler and Reaction that allow for Reaction “commands” to be written.
Similar to Commands, Inhibitors and Listeners, you add a ReactionHandler in your client constructor like this:
super({ ownerID: OWNER_ID, partials: ['MESSAGE', 'CHANNEL', 'REACTION'] });
this.reactionHandler = new ReactionHandler(this, { directory: 'src/reactions/' }).loadAll();
Notice that for reactions to old messages to work, you have to configure discord.js with at least the three partials listed above.
Then place a file like this log.js
into src/reactions
:
const Reaction = require("../struct/Reaction");
class LogReaction extends Reaction {
constructor() {
super('log-reactions', {});
}
exec(reaction, reactionType, user) {
console.log(`User <@${user.id}> ${reactionType} ${reaction.emoji} to/from ${reaction.message.id}.`);
}
}
module.exports = LogReaction;
I intend to add Inhibitors and possibly the ability to filter out reactions from bots, etc as is possible with Commands. I’m not currently planning on adding Cooldowns, Typing indication, Permissions, etc. I’m curious if folks are interested in a contribution like this and if it would be accepted as a contribution?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
discord-akairo/discord-akairo: A bot framework for Discord.js.
Features. Completely modular commands, inhibitors, and listeners. Reading files recursively from directories. Adding, removing, and reloading modules.
Read more >Discord mod bot github - Allevamento di Casa Lopresti
In this we will be creating a simple discord bot which retur **pong** when we type ... High Quality Music Radio, Moderation, Custom...
Read more >Check if user have the role x when he add a reaction and give ...
When do you want the bot to give the role? Check if the checks are right. Your code executes the second if only...
Read more >basic discord bot github
Contribute to rx0f/simple-discord-bot development by creating an account on GitHub. ... Add as many reaction roles as you want to your message!
Read more >How to Make a Discord Bot: An Overview and Tutorial - Toptal
3) Add a bot user connected to the application. screenshot of adding a bot user. 4) Turn off the PUBLIC BOT switch and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s not different. What it does is integrate doing so the same way that that Command and CommandHandler integrate listening for the message (and possibly messageUpdate) events.
I really want to add Inhibitors for reactions as well. As such I’m thinking of renaming Reaction to ReactionCommand and ReactionHandler to ReactionCommandHandler. Then We can have ReactionInhibitor and ReactionInhibitorHandler.
As an alternative, maybe Inhibitor and InhibitorHandler could be made more generic so they can inhibit Commands and Reactions.
@1Computer1 if you are interested in such a contribution, I’d love to know how you think this should be handled?