This snippet sends a message to a channel of your choice when a role is updated in your server - regardless of whether the role's permissions, name, color, etc. any change about the role will logged.
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 updated`,
description: `A role has just been updated!`,//You can change the color of the embed here
color: 0xffbf00,
footer: {
text: `You can find more information in the audit logs!`,
},
},
],
});