This commit is contained in:
Jonny_Bro (Nikita) 2024-01-23 16:11:10 +05:00
parent 8353cf0461
commit f33ff35e4b
No known key found for this signature in database
GPG key ID: 28B0D27F8DD5A4C9
3 changed files with 11 additions and 9 deletions

View file

@ -59,18 +59,19 @@ class Remindme extends BaseCommand {
async execute(client, interaction, data) { async execute(client, interaction, data) {
await interaction.deferReply({ ephemeral: true }); 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 = []; 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, message: message,
createdAt: dateNow, createdAt: dateNow,
sendAt: dateNow + ms(time), sendAt: dateNow + ms(time),
}; };
data.userData.reminds.push(rData); data.userData.reminds.push(reminderData);
data.userData.markModified("reminds"); data.userData.markModified("reminds");
await data.userData.save(); await data.userData.save();
@ -79,7 +80,7 @@ class Remindme extends BaseCommand {
interaction.success("general/remindme:SAVED", { interaction.success("general/remindme:SAVED", {
message, 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 }); }, { edit: true });
} }
} }

View file

@ -119,6 +119,7 @@ class Nowplaying extends BaseCommand {
ephemeral: true, ephemeral: true,
}); });
// TODO: Fix collected if user doesnt send anything
const filter = m => m.author.id === interaction.user.id && m.content.startsWith("http"), 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(), 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], 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],

View file

@ -11,7 +11,7 @@ module.exports.init = async function (client) {
const guildData = await client.findOrCreateGuild(guild.id); const guildData = await client.findOrCreateGuild(guild.id);
if (guildData.plugins.birthdays) { 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(), date = new Date(),
currentDay = date.getDate(), currentDay = date.getDate(),
currentMonth = date.getMonth(), currentMonth = date.getMonth(),
@ -70,7 +70,7 @@ module.exports.run = async function (client) {
const guildData = await client.findOrCreateGuild(guild.id); const guildData = await client.findOrCreateGuild(guild.id);
if (guildData.plugins.birthdays) { 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(), date = new Date(),
currentDay = date.getDate(), currentDay = date.getDate(),
currentMonth = date.getMonth(), currentMonth = date.getMonth(),