A message will automatically be sent when a user in the guild provides a boost. You can later change whether the mention will be by their nickname or their original username, and the message content itself. You will also be asked to provide a channel id when you add this snippet. If you'd ever like to change the channel, you can do so by going to the editor >> the bottom left corner where it says Environment variables >> change the value of the one with key "mesChannel" .
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let messageChannel = process.env.mesChannel;
console.log(parseInt(context.params.event.premium_since) < 60);
if (context.params.event.premium_since != null) {
if (parseInt(context.params.event.premium_since) < 60) {
await lib.discord.channels['@0.3.1'].messages.create({
channel_id: messageChannel,
content: `Thank you for boosting this server, <@!${context.params.event.user.id}>.`,
tts: false,
});
}
}