Send a message and remove streaming status from your Discord bot when your stream goes offline
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const discordChannel = 'ANNOUNCEMENT_CHANNEL_ID'; // Set this to the channel ID you want to send announcements to
await lib.discord.users['@0.1.2'].me.status.update({
activity_name: '',
status: 'ONLINE'
});
await lib.discord.channels['@0.1.1'].messages.create({
"channel_id": discordChannel,
"content": "That's all folks! Thanks for coming π₯³",
"tts": false,
});