This snippet will help your bot send a message whenever it is mentioned. See comment below to find which messages the bot will send. Update them as you wish!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const userId = context.params.event.author.id;
//Update your messages below!
const responses = [
`Hey, <@${userId}>!`,
`Yes, why do you need me?`,
`I don't understand!`,
`Please stop calling me!`,
`Stop the ping!`,
`AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!`,
];
let counter = await lib.keyvalue.store['@0.1.16'].get({
key: `bot_mention_counter_${context.params.event.guild_id}`,
defaultValue: 0,
});
if (counter > responses.length - 1) counter = 0;
await lib.discord.channels['@0.3.2'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `${responses[counter]}`,
message_reference: {
'message_id': `${context.params.event.id}`
}
});
counter = counter + 1;
await lib.keyvalue.store['@0.1.16'].set({
key: `bot_mention_counter_${context.params.event.guild_id}`,
value: counter,
});