From 519bbd07b973a7c406fc4579c007c5d8cfb42a1f Mon Sep 17 00:00:00 2001 From: Kieran Date: Sun, 4 Sep 2022 19:03:49 +0100 Subject: [PATCH] Fixed BST --- events/guildScheduledEvent.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/events/guildScheduledEvent.js b/events/guildScheduledEvent.js index 2e64b7c..d21dc21 100644 --- a/events/guildScheduledEvent.js +++ b/events/guildScheduledEvent.js @@ -1,7 +1,6 @@ const { MessageEmbed } = require('discord.js'); const client = require("../index"); - client.on('guildScheduledEventCreate', async guildScheduledEvent =>{ const channel = client.channels.cache.get('973686987787751534') const embed = new MessageEmbed() @@ -12,15 +11,13 @@ client.on('guildScheduledEventCreate', async guildScheduledEvent =>{ .setImage(`https://cdn.discordapp.com/guild-events/${guildScheduledEvent.id}/${guildScheduledEvent.image}.png`) .addField('Description', `${guildScheduledEvent.description}`) - if(guildScheduledEvent.entityType !== 'EXTERNAL') - { + if(guildScheduledEvent.entityType !== 'EXTERNAL'){ embed.addField('Location', `${guildScheduledEvent.channel.name} - [Link](https://discordapp.com/channels/427865794467069962/${guildScheduledEvent.channelId})`) } - else{ - embed.addField('Location', `External - ${guildScheduledEvent.entityMetadata.location}`) - } + else{ + embed.addField('Location', `External - ${guildScheduledEvent.entityMetadata.location}`)} - embed.addField('Start Date and Time', ` ${guildScheduledEvent.scheduledStartAt.toLocaleString('en-UK, BST', { timeZone: "Europe/London" })}`, true) + embed.addField('Start Date and Time', ` ${guildScheduledEvent.scheduledStartAt.toLocaleString('en-UK', { timeZone: "Europe/London" })}`, true) if(guildScheduledEvent.scheduledEndAt !== null) { @@ -28,5 +25,6 @@ client.on('guildScheduledEventCreate', async guildScheduledEvent =>{ } embed.addField('InviteURL', `${guildScheduledEvent.url}`) + channel.send({ embeds: [embed]}) }) \ No newline at end of file