From f33ff35e4b08f47558bf0cf406d075813897f51c Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Tue, 23 Jan 2024 16:11:10 +0500 Subject: [PATCH] pweaase --- commands/General/remindme.js | 13 +++++++------ commands/Music/nowplaying.js | 1 + helpers/birthdays.js | 6 +++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/commands/General/remindme.js b/commands/General/remindme.js index 1c139566..603046c8 100644 --- a/commands/General/remindme.js +++ b/commands/General/remindme.js @@ -59,18 +59,19 @@ class Remindme extends BaseCommand { async execute(client, interaction, data) { await interaction.deferReply({ ephemeral: true }); - const time = interaction.options.getString("time"); - const message = interaction.options.getString("message"); - const dateNow = Date.now(); if (!data.userData.reminds) data.userData.reminds = []; + // TODO: rework this shit + const time = interaction.options.getString("time"), + message = interaction.options.getString("message"), + dateNow = Date.now(); - const rData = { + const reminderData = { message: message, createdAt: dateNow, sendAt: dateNow + ms(time), }; - data.userData.reminds.push(rData); + data.userData.reminds.push(reminderData); data.userData.markModified("reminds"); await data.userData.save(); @@ -79,7 +80,7 @@ class Remindme extends BaseCommand { interaction.success("general/remindme:SAVED", { message, - time: moment(rData.sendAt).locale(interaction.getLocale()).format("dddd, Do MMMM YYYY, HH:mm:ss"), + time: moment(reminderData.sendAt).locale(interaction.getLocale()).format("Do MMMM YYYY, HH:mm:ss"), }, { edit: true }); } } diff --git a/commands/Music/nowplaying.js b/commands/Music/nowplaying.js index 325a61fa..fbe4856d 100644 --- a/commands/Music/nowplaying.js +++ b/commands/Music/nowplaying.js @@ -119,6 +119,7 @@ class Nowplaying extends BaseCommand { ephemeral: true, }); + // TODO: Fix collected if user doesnt send anything const filter = m => m.author.id === interaction.user.id && m.content.startsWith("http"), collected = (await interaction.channel.awaitMessages({ filter, time: 10 * 1000, max: 1 })).first(), query = collected.content.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/g)[0], diff --git a/helpers/birthdays.js b/helpers/birthdays.js index 33354de0..13012299 100644 --- a/helpers/birthdays.js +++ b/helpers/birthdays.js @@ -11,7 +11,7 @@ module.exports.init = async function (client) { const guildData = await client.findOrCreateGuild(guild.id); if (guildData.plugins.birthdays) { - const channel = guild.channels.cache.get(guildData.plugins.birthdays) || await guild.channels.fetch(guildData.plugins.birthdays), + const channel = guild.channels.cache.get(guildData.plugins.birthdays), date = new Date(), currentDay = date.getDate(), currentMonth = date.getMonth(), @@ -70,7 +70,7 @@ module.exports.run = async function (client) { const guildData = await client.findOrCreateGuild(guild.id); if (guildData.plugins.birthdays) { - const channel = guild.channels.cache.get(guildData.plugins.birthdays) || await guild.channels.fetch(guildData.plugins.birthdays), + const channel = guild.channels.cache.get(guildData.plugins.birthdays), date = new Date(), currentDay = date.getDate(), currentMonth = date.getMonth(), @@ -116,4 +116,4 @@ module.exports.run = async function (client) { } } }); -}; +}; \ No newline at end of file