Moved Assets to Subdir, Migrated some old commands
This commit is contained in:
@@ -176,7 +176,7 @@ async function quotesRandom(interaction) {
|
||||
]).toArray()
|
||||
}
|
||||
const found = rdm[0]
|
||||
if (!found) { return await interaction.reply({ content: 'Database Empty', flags: MessageFlags.Ephemeral }) }
|
||||
if (!found) { return await interaction.reply({ content: 'No Entry Found.', flags: MessageFlags.Ephemeral }) }
|
||||
const guild = await interaction.client.guilds.fetch(found.guildID)
|
||||
const channel = await guild.channels.fetch(found.channelID)
|
||||
const message = await channel.messages.fetch(found.messageID)
|
||||
@@ -273,7 +273,7 @@ async function quotesLeaderboard(interaction) {
|
||||
let skip = 0
|
||||
const minValue = 0
|
||||
const maxValue = await quotesColl.countDocuments({ $and: [{ guildID: interaction.guild.id }, { count: { $gt: 0 } }] })
|
||||
|
||||
|
||||
const quotesData = await quotesColl.find({}).sort({ count: -1, messageID: -1 }).skip(skip).limit(5).toArray()
|
||||
const fields = []
|
||||
|
||||
@@ -282,20 +282,20 @@ async function quotesLeaderboard(interaction) {
|
||||
|
||||
let channel = await guild.channels.fetch(data.channelID)
|
||||
let message = await channel.messages.fetch(data.messageID)
|
||||
|
||||
|
||||
await delay(500)
|
||||
let timestamp = new Date(message.createdTimestamp)
|
||||
fields.push({
|
||||
name: `${index + 1}.`,//`\u200b` ,
|
||||
value: `[#${data.messageID}](https://discord.com/channels/${data.guildID}/${data.channelID}/${data.messageID})\r\n**by** <@${data.by}> • ⭐ ${data.count}\r\n_Posted on **${timestamp}**_\r\n${message.content}`
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
await delay(5000)
|
||||
console.log(fields)
|
||||
quotesData.sort((a,b) => {
|
||||
quotesData.sort((a, b) => {
|
||||
const numA = parseInt(a.name);
|
||||
const numB = parseInt(b.name);
|
||||
return numA - numB;
|
||||
|
||||
Reference in New Issue
Block a user