mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-12-29 23:03:02 +05:00
Compare commits
4 commits
4728258071
...
62e8c7a244
Author | SHA1 | Date | |
---|---|---|---|
62e8c7a244 | |||
83866db885 | |||
e079b035b9 | |||
e50c36a967 |
3 changed files with 11 additions and 10 deletions
|
@ -124,7 +124,7 @@ class Boosters extends BaseCommand {
|
|||
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 });
|
||||
|
||||
const embeds = generateBoostersEmbeds(client, interaction, boosters);
|
||||
const embeds = generateBoostersEmbeds(interaction, boosters);
|
||||
|
||||
const row = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setCustomId("boosters_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"),
|
||||
|
@ -159,7 +159,7 @@ function generateBoostersEmbeds(interaction, boosters) {
|
|||
let j = i;
|
||||
k += 10;
|
||||
|
||||
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 info = current.map(member => `${++j}. ${member.toString()} | ${interaction.translate("general/boosters:BOOSTER_SINCE")}: <t:${Math.floor(member.premiumSinceTimestamp / 1000)}:f>`).join("\n");
|
||||
|
||||
const embed = interaction.client.embed({
|
||||
title: interaction.translate("general/boosters:BOOSTERS_LIST"),
|
||||
|
|
|
@ -33,14 +33,13 @@ class CreateTicketEmbed extends BaseCommand {
|
|||
interaction.data = [];
|
||||
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;
|
||||
|
||||
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) {
|
||||
const sorted = interaction.guild.channels.cache.get(ticketsCategory).children.cache.sort((ch1, ch2) => ch1.createdTimestamp - ch2.createdTimestamp);
|
||||
|
||||
|
@ -137,8 +136,10 @@ class CreateTicketEmbed extends BaseCommand {
|
|||
|
||||
collector.on("end", async (_, reason) => {
|
||||
if (reason !== "canceled") {
|
||||
const reversedMessages = (await interaction.channel.messages.fetch()).filter(m => !m.author.bot);
|
||||
const messages = Array.from(reversedMessages.values()).reverse();
|
||||
const reversedMessages = (await interaction.channel.messages.fetch()).filter(m => !m.author.bot),
|
||||
messages = Array.from(reversedMessages.values()).reverse(),
|
||||
transcriptionLogs = interaction.data.guild.plugins.tickets.transcriptionLogs,
|
||||
ticketLogs = interaction.data.guild.plugins.tickets.ticketLogs;
|
||||
|
||||
if (messages.length > 1) {
|
||||
let transcript = "---- TICKET CREATED ----\n";
|
||||
|
|
|
@ -56,7 +56,7 @@ module.exports.init = async client => {
|
|||
});
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.code === 10003) console.log("Unknown channel");
|
||||
if (err.code === 10003) console.log(`No channel found for ${guild.name}`);
|
||||
else throw err;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue