diff --git a/events/guildScheduledEvent.js b/events/guildScheduledEvent.js new file mode 100644 index 0000000..fd22f31 --- /dev/null +++ b/events/guildScheduledEvent.js @@ -0,0 +1,21 @@ +const { Permissions } = require('discord.js'); +const client = require("../index"); +const discord = require('discord.js'); + + +client.on('guildScheduledEventCreate', async guildScheduledEvent =>{ + const guild = client.guilds.cache.get('427865794467069962'); + const channel = client.channels.cache.get('849708647953334282') + const embed = new discord.MessageEmbed() + .setColor('GREEN') + .setFooter(`Created by ${guildScheduledEvent.creator}`) + .setTimestamp() + .setTitle("New Event") + .addField('Name:', `${guildScheduledEvent.name}`) + .addField('Description', `${guildScheduledEvent.description}`) + .addField('Location', `Please check the URL linked.`) + .addField('Start Date and Time', ` ${guildScheduledEvent.scheduledStartAt}`, true) + .addField('End Date and Time', `${guildScheduledEvent.scheduledEndAt}`, true) + .addField('InviteURL', `${guildScheduledEvent.url}`) + channel.send({ embeds: [embed] }) +}) \ No newline at end of file diff --git a/index.js b/index.js index 67733f0..c4e9fe6 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const { Client, Collection } = require("discord.js"); const client = new Client({ - intents: 32767, + intents: ["GUILDS", "GUILD_MESSAGES", "GUILD_SCHEDULED_EVENTS"], }); module.exports = client;