Give a specific role when a user first sends a message in a specific channel. Don’t forget to add the channel id on line 4, role id on line 6, and guild id on line 8.
// authenticates you with the API standard library
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
if (context.params.event.channel_id === 'the channel id') {
await lib.discord.guilds['@0.1.0'].members.roles.update({
role_id: `the role id to be given`,
user_id: `${context.params.event.author.id}`, // be sure to add a dummy payload before launching
guild_id: `your guild id`,
});
}