mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54:58 +05:00
pweaase
This commit is contained in:
parent
8353cf0461
commit
f33ff35e4b
3 changed files with 11 additions and 9 deletions
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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) {
|
|||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
Loading…
Reference in a new issue