You can know when the bot is pinged, in which channel its pinged in, the server its pinged in, who pinged it, and even what the message was !
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let message = context.params.event.content;
let channel = context.params.event.channel_id;
let sender = context.params.event.author.username;
let user = context.params.event.author.id;
let server = await lib.discord.guilds['@0.1.0'].retrieve({
guild_id: context.params.event.guild_id,
});
console.log(server.name);
console.log(`Channel = ${channel}`);
console.log(`Message = ${message}`);
console.log(`Sent by ${sender}`);
console.log(`Sent by ${user}`);
await lib.discord.users['@0.1.5'].dms.create({
recipient_id: `${process.env.user_id}`,
content: `**<@${user}>** (**${user}**) pinged the bot in the channel **<#${channel}>** (${channel}) , in the server **${server.name}** . They said : "**${message}**" .`,
});