Added image to event embed and check for null end
parent
27f6a9d756
commit
4d99e0f2bc
|
@ -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] })
|
||||
})
|
Loading…
Reference in New Issue