This snippet sends a message to a channel of your choice when a role in your server is deleted
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const event = context.params.event;
await lib.discord.channels['@0.3.2'].messages.create({
channel_id: `${process.env.LOG_CHANNEL_ID}`, //This is where the channel ID of your log channel comes in
content: '',
tts: false,
embeds: [
{
type: 'rich',
title: `Role deleted`,
description: `A role has just been deleted!`,
color: 0xff0000, //You can change the color of the embed here
footer: {
text: `You can find more information in the audit logs!`,
},
},
],
});