Create activities in Discord Voice channels! Create the slash command (instructions are in comments line 3 - 11) Then do /activity [type of activity] Credit to MEIRBA for the original activities code
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
//IMPORTANT: Create a command in the slash command builder and name it "activity"
//IMPORTANT: Next go to options set it to string name it what you want then click "advanced"
//IMPORTANT: Then add 6 options, set their values to what's listed below...
//IMPORTANT: Option 1: youtube
//IMPORTANT: Option 2: poker
//IMPORTANT: Option 3: chess
//IMPORTANT: Option 4: checkers
//IMPORTANT: Option 5: betrayal
//IMPORTANT: Option 6: fishing
if (context.params.event.data.options[0].value === `youtube`) {
let invite = await lib.discord.invites['@0.1.0'].create({
channel_id: `${process.env.activity_channel_id}`,
max_age: 86400,
max_uses: 0,
temporary: false,
unique: false,
target_type: 'EMBEDDED_APPLICATION',
target_application_id: `755600276941176913`,
});
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: context.params.event.channel_id,
content: `<@${context.params.event.member.user.id}>`,
embeds: [
{
type: 'rich',
title: `YouTube`,
description: `Click [here](https://discord.com/invite/${invite.code}) to use **YouTube Together!**`,
color: 0xd4101d,
thumbnail: {
url: `https://cdn.discordapp.com/app-icons/${invite.target_application.id}/${invite.target_application.icon}.png`,
},
},
],
});
}
if (context.params.event.data.options[0].value === `poker`) {
let invite = await lib.discord.invites['@0.1.0'].create({
channel_id: `${process.env.activity_channel_id}`,
max_age: 86400,
max_uses: 0,
temporary: false,
unique: false,
target_type: 'EMBEDDED_APPLICATION',
target_application_id: `755827207812677713`,
});
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: context.params.event.channel_id,
content: `<@${context.params.event.member.user.id}>`,
embeds: [
{
type: 'rich',
title: `Poker`,
description: `Click [here](https://discord.com/invite/${invite.code}) to play **Poker!**`,
color: 0x006300,
thumbnail: {
url: `https://cdn.discordapp.com/app-icons/${invite.target_application.id}/${invite.target_application.icon}.png`,
},
},
],
});
}
if (context.params.event.data.options[0].value === `chess`) {
let invite = await lib.discord.invites['@0.1.0'].create({
channel_id: `${process.env.activity_channel_id}`,
max_age: 86400,
max_uses: 0,
temporary: false,
unique: false,
target_type: 'EMBEDDED_APPLICATION',
target_application_id: `832012774040141894`,
});
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: context.params.event.channel_id,
content: `<@${context.params.event.member.user.id}>`,
embeds: [
{
type: 'rich',
title: `Chess`,
description: `Click [here](https://discord.com/invite/${invite.code}) to play **Chess!**`,
color: 0xc7bb94,
thumbnail: {
url: `https://cdn.discordapp.com/app-icons/${invite.target_application.id}/${invite.target_application.icon}.png`,
},
},
],
});
}
if (context.params.event.data.options[0].value === `betrayal`) {
let invite = await lib.discord.invites['@0.1.0'].create({
channel_id: `${process.env.activity_channel_id}`,
max_age: 86400,
max_uses: 0,
temporary: false,
unique: false,
target_type: 'EMBEDDED_APPLICATION',
target_application_id: `773336526917861400`,
});
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: context.params.event.channel_id,
content: `<@${context.params.event.member.user.id}>`,
embeds: [
{
type: 'rich',
title: `Betrayal`,
description: `Click [here](https://discord.com/invite/${invite.code}) to play **Betrayal!**`,
color: 0xc7bb94,
thumbnail: {
url: `https://cdn.discordapp.com/app-icons/${invite.target_application.id}/${invite.target_application.icon}.png`,
},
},
],
});
}
if (context.params.event.data.options[0].value === `fishing`) {
let invite = await lib.discord.invites['@0.1.0'].create({
channel_id: `${process.env.activity_channel_id}`,
max_age: 86400,
max_uses: 0,
temporary: false,
unique: false,
target_type: 'EMBEDDED_APPLICATION',
target_application_id: `814288819477020702`,
});
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: context.params.event.channel_id,
content: `<@${context.params.event.member.user.id}>`,
embeds: [
{
type: 'rich',
title: `Fishing`,
description: `Click [here](https://discord.com/invite/${invite.code}) to go **Fishing!**`,
color: 0x0072cb,
thumbnail: {
url: `https://cdn.discordapp.com/app-icons/${invite.target_application.id}/${invite.target_application.icon}.png`,
},
},
],
});
}
if (context.params.event.data.options[0].value === `checkers`) {
let invite = await lib.discord.invites['@0.1.0'].create({
channel_id: `${process.env.activity_channel_id}`,
max_age: 86400,
max_uses: 0,
temporary: false,
unique: false,
target_type: 'EMBEDDED_APPLICATION',
target_application_id: `832013003968348200`,
});
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: context.params.event.channel_id,
content: `<@${context.params.event.member.user.id}>`,
embeds: [
{
type: 'rich',
title: `Checkers`,
description: `Click [here](https://discord.com/invite/${invite.code}) to play **Checkers!**`,
color: 0xd9e13d,
thumbnail: {
url: `https://cdn.discordapp.com/app-icons/${invite.target_application.id}/${invite.target_application.icon}.png`,
},
},
],
});
}
//Credit to MEIRBA for main part of the code :)