Make timestamps use time discordjs builder

imgbot
Kieran 2022-09-07 20:06:49 +01:00
parent d9fd2058d8
commit 113d1219f9
2 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,6 @@
const { MessageEmbed } = require('discord.js');
const client = require("../index");
const { MessageEmbed } = require('discord.js');
const { time } = require("@discordjs/builders");
client.on('guildScheduledEventCreate', async guildScheduledEvent =>{
const channel = client.channels.cache.get('973686987787751534')
@ -20,10 +21,10 @@ client.on('guildScheduledEventCreate', async guildScheduledEvent =>{
embed.addField('Location', `External - ${guildScheduledEvent.entityMetadata.location}`)
}
embed.addField('Start Date and Time', ` ${guildScheduledEvent.scheduledStartAt.toLocaleString('en-UK', { timeZone: "Europe/London" })}`, true)
embed.addField('Start Date and Time', `${guildScheduledEvent.scheduledStartTimestamp ? time(guildScheduledEvent.scheduledStartTimestamp, "F") : "Unknown"}`, true)
if(guildScheduledEvent.scheduledEndAt !== null)
{
embed.addField('End Date and Time', `${guildScheduledEvent.scheduledEndAt.toLocaleString("en-UK", { timeZone: "Europe/London" })}`, true)
embed.addField('End Date and Time', `${guildScheduledEvent.scheduledEndTimestamp ? time(guildScheduledEvent.scheduledEndTimestamp, "F") : "Unknown"}`, true)
}
embed.addField('InviteURL', `${guildScheduledEvent.url}`)

View File

@ -83,14 +83,13 @@ client.on("interactionCreate", async (interaction) => {
await interaction.reply({ content: 'Message has been deleted', ephemeral: true});
}
if(interaction.isButton)
if(interaction.customId == "CloseThread")
{
if(interaction.customId == "CloseThread")
{
interaction.reply(`This channel has been archived, you can unarchive this thread by sending another message.`)
interaction.channel.setArchived(true)
}
}
}
// Select Menu Handling