Autoreaction to messages in a specified channel. Please note it will react to ALL messages unless you specifically code it to certain words/phrases. This is pretty cool for Introduction Channels, where you can automatically react to each introduction posted.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
if (context.params.event.channel_id !== `${process.env.CHANNEL_ID}`) {
let result = await lib.discord.channels['@0.2.0'].messages.reactions.create({
emoji: `👋`,
message_id: `${context.params.event.id}`,
channel_id: `${process.env.CHANNEL_ID}`,
});
}
if (context.params.event.channel_id !== `${process.env.CHANNEL_ID}`) {
let result = await lib.discord.channels['@0.2.0'].messages.reactions.create({
emoji: `❤️`,
message_id: `${context.params.event.id}`,
channel_id: `${process.env.CHANNEL_ID}`, // This is the same channel ID as line 6
});
}