hullcss-discord-bot/events/guildScheduledEvent.js

20 lines
941 B
JavaScript
Raw Normal View History

2022-05-10 21:39:54 +01:00
const { Permissions } = require('discord.js');
const client = require("../index");
const discord = require('discord.js');
client.on('guildScheduledEventCreate', async guildScheduledEvent =>{
2022-05-10 21:47:31 +01:00
const channel = client.channels.cache.get('973686987787751534')
2022-05-10 21:39:54 +01:00
const embed = new discord.MessageEmbed()
.setColor('GREEN')
2022-07-04 17:53:51 +01:00
.setFooter(`Created by ${guildScheduledEvent.creator.tag}`)
2022-05-10 21:39:54 +01:00
.setTimestamp()
.setTitle("New Event")
.addField('Name:', `${guildScheduledEvent.name}`)
.addField('Description', `${guildScheduledEvent.description}`)
.addField('Location', `Please check the URL linked.`)
2022-07-04 17:52:09 +01:00
.addField('Start Date and Time', ` ${guildScheduledEvent.scheduledStartAt.toLocaleDateString("en-UK")}`, true)
.addField('End Date and Time', `${guildScheduledEvent.scheduledEndAt.toLocaleDateString("en-UK")}`, true)
2022-05-10 21:39:54 +01:00
.addField('InviteURL', `${guildScheduledEvent.url}`)
channel.send({ embeds: [embed] })
})