Added image to event embed and check for null end

imgbot
Kieran 2022-07-04 18:56:53 +01:00
parent 27f6a9d756
commit 4d99e0f2bc
1 changed files with 6 additions and 2 deletions

View File

@ -10,11 +10,15 @@ client.on('guildScheduledEventCreate', async guildScheduledEvent =>{
.setFooter(`Created by ${guildScheduledEvent.creator.tag}`)
.setTimestamp()
.setTitle("New Event")
.setImage(guildScheduledEvent.image)
.addField('Name:', `${guildScheduledEvent.name}`)
.addField('Description', `${guildScheduledEvent.description}`)
.addField('Location', `Please check the URL linked.`)
.addField('Start Date and Time', ` ${guildScheduledEvent.scheduledStartAt.toLocaleDateString("en-UK")}`, true)
.addField('End Date and Time', `${guildScheduledEvent.scheduledEndAt.toLocaleDateString("en-UK")}`, true)
.addField('InviteURL', `${guildScheduledEvent.url}`)
if(guildScheduledEvent.scheduledEndAt !== null)
{
embed.addField('End Date and Time', `${guildScheduledEvent.scheduledEndAt.toLocaleDateString("en-UK")}`, true)
}
embed.addField('InviteURL', `${guildScheduledEvent.url}`)
channel.send({ embeds: [embed] })
})