mirror of
https://github.com/JonnyBro/JaBa.git
synced 2025-01-06 10:43:02 +05:00
Compare commits
No commits in common. "62e8c7a244c6ca734983f2c1316024131444a90d" and "47282580718f40b54df7953f04ac02f72b075016" have entirely different histories.
62e8c7a244
...
4728258071
3 changed files with 10 additions and 11 deletions
|
@ -124,7 +124,7 @@ class Boosters extends BaseCommand {
|
||||||
const boosters = (await interaction.guild.members.fetch()).filter(m => m.premiumSince);
|
const boosters = (await interaction.guild.members.fetch()).filter(m => m.premiumSince);
|
||||||
if (boosters.size === 0) return interaction.error("general/boosters:NO_BOOSTERS", null, { edit: true });
|
if (boosters.size === 0) return interaction.error("general/boosters:NO_BOOSTERS", null, { edit: true });
|
||||||
|
|
||||||
const embeds = generateBoostersEmbeds(interaction, boosters);
|
const embeds = generateBoostersEmbeds(client, interaction, boosters);
|
||||||
|
|
||||||
const row = new ActionRowBuilder().addComponents(
|
const row = new ActionRowBuilder().addComponents(
|
||||||
new ButtonBuilder().setCustomId("boosters_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
new ButtonBuilder().setCustomId("boosters_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
||||||
|
@ -159,7 +159,7 @@ function generateBoostersEmbeds(interaction, boosters) {
|
||||||
let j = i;
|
let j = i;
|
||||||
k += 10;
|
k += 10;
|
||||||
|
|
||||||
const info = current.map(member => `${++j}. ${member.toString()} | ${interaction.translate("general/boosters:BOOSTER_SINCE")}: <t:${Math.floor(member.premiumSinceTimestamp / 1000)}:f>`).join("\n");
|
const info = current.map(member => `${++j}. ${member.toString()} | ${interaction.translate("general/boosters:BOOSTER_SINCE")}: **${Math.floor(new Date(member.premiumSince).getTime() / 1000)}**`).join("\n");
|
||||||
|
|
||||||
const embed = interaction.client.embed({
|
const embed = interaction.client.embed({
|
||||||
title: interaction.translate("general/boosters:BOOSTERS_LIST"),
|
title: interaction.translate("general/boosters:BOOSTERS_LIST"),
|
||||||
|
|
|
@ -33,13 +33,14 @@ class CreateTicketEmbed extends BaseCommand {
|
||||||
interaction.data = [];
|
interaction.data = [];
|
||||||
interaction.data.guild = await client.getGuildData(interaction.guildId);
|
interaction.data.guild = await client.getGuildData(interaction.guildId);
|
||||||
|
|
||||||
|
const guildData = interaction.data.guild,
|
||||||
|
ticketsCategory = guildData.plugins?.tickets?.ticketsCategory,
|
||||||
|
ticketLogs = guildData.plugins?.tickets?.ticketLogs,
|
||||||
|
transcriptionLogs = guildData.plugins?.tickets?.transcriptionLogs;
|
||||||
|
|
||||||
const button = interaction.component;
|
const button = interaction.component;
|
||||||
|
|
||||||
if (button.customId === "support_ticket") {
|
if (button.customId === "support_ticket") {
|
||||||
const guildData = interaction.data.guild,
|
|
||||||
ticketsCategory = guildData.plugins.tickets.ticketsCategory,
|
|
||||||
ticketLogs = guildData.plugins.tickets.ticketLogs;
|
|
||||||
|
|
||||||
if (interaction.guild.channels.cache.get(ticketsCategory).children.cache.size >= 50) {
|
if (interaction.guild.channels.cache.get(ticketsCategory).children.cache.size >= 50) {
|
||||||
const sorted = interaction.guild.channels.cache.get(ticketsCategory).children.cache.sort((ch1, ch2) => ch1.createdTimestamp - ch2.createdTimestamp);
|
const sorted = interaction.guild.channels.cache.get(ticketsCategory).children.cache.sort((ch1, ch2) => ch1.createdTimestamp - ch2.createdTimestamp);
|
||||||
|
|
||||||
|
@ -136,10 +137,8 @@ class CreateTicketEmbed extends BaseCommand {
|
||||||
|
|
||||||
collector.on("end", async (_, reason) => {
|
collector.on("end", async (_, reason) => {
|
||||||
if (reason !== "canceled") {
|
if (reason !== "canceled") {
|
||||||
const reversedMessages = (await interaction.channel.messages.fetch()).filter(m => !m.author.bot),
|
const reversedMessages = (await interaction.channel.messages.fetch()).filter(m => !m.author.bot);
|
||||||
messages = Array.from(reversedMessages.values()).reverse(),
|
const messages = Array.from(reversedMessages.values()).reverse();
|
||||||
transcriptionLogs = interaction.data.guild.plugins.tickets.transcriptionLogs,
|
|
||||||
ticketLogs = interaction.data.guild.plugins.tickets.ticketLogs;
|
|
||||||
|
|
||||||
if (messages.length > 1) {
|
if (messages.length > 1) {
|
||||||
let transcript = "---- TICKET CREATED ----\n";
|
let transcript = "---- TICKET CREATED ----\n";
|
||||||
|
|
|
@ -56,7 +56,7 @@ module.exports.init = async client => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 10003) console.log(`No channel found for ${guild.name}`);
|
if (err.code === 10003) console.log("Unknown channel");
|
||||||
else throw err;
|
else throw err;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue