When ever your bot joins a server it will send a message in any of the mentioned channels in *generalChannel.id*
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let guilds = await lib.discord.guilds['@0.0.6'].list({
limit: 200,
});
let channels = await lib.discord.guilds['@0.0.6'].channels.list({
guild_id: guilds[0].id,
});
let generalChannel = channels.find((channel) => {
return (
channel.name ===
('general', 'main-chat', 'verification', 'welcome', 'lounge', 'rules')
);
});
if (generalChannel) {
await lib.discord.channels['@0.1.0'].messages.create({
channel_id: generalChannel.id,
content: `I am Ronan Films Utility! I am here to help Ronan make his life easy!`,
});
}