Added dm warn on blacklist

This commit is contained in:
Ninjdai 2023-11-19 00:38:30 +01:00
parent 3e339391f5
commit 54ccaa3001
11 changed files with 11 additions and 1588 deletions

View File

@ -1,84 +0,0 @@
import {
EmbedBuilder,
StringSelectMenuBuilder,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
} from "discord.js";
export default {
async execute(interaction, client) {
await interaction.deferReply({ ephemeral: true });
const channel = interaction.options.getChannel("channel");
const ticketEmbed = new EmbedBuilder();
switch (interaction.options.getString("type")) {
case "commands":
ticketEmbed
.setColor(`#7961fd`)
.setTitle("Commandes")
.setDescription(
"Tu veux passer commande ? Choisis ci-dessous en fonction de ton budget ! ^^",
)
.setThumbnail(
`https://media.discordapp.net/attachments/867491241491038209/987292546180984832/april-welcome.png`,
);
channel.send({
embeds: [ticketEmbed],
components: [ticketgraphismtyperow],
});
break;
case "support":
ticketEmbed
.setColor(`#7961fd`)
.setTitle("Tickets")
.setDescription(
"Tu veux faire une demande de partenariat / contacter le staff ?\nChoisis avec le menu déroulant çi-dessous ! ^^",
)
.setThumbnail(
`https://media.discordapp.net/attachments/867491241491038209/987292546180984832/april-welcome.png`,
);
channel.send({
embeds: [ticketEmbed],
components: [ticketsupportRow],
});
break;
}
await interaction.editReply({ content: "Panel envoyé avec succès !" });
},
};
const ticketgraphismtyperow = new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setCustomId("ticketopener_paid")
.setLabel("Commande rémunérée")
.setStyle(ButtonStyle.Success),
new ButtonBuilder()
.setCustomId("ticketopener_free")
.setLabel("Commande bénévole")
.setStyle(ButtonStyle.Success),
]);
const ticketsupportRow = new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId("ticket_create-support")
.setPlaceholder("Choisissez le type de ticket que vous voulez !")
.addOptions([
{
label: "Demande de partenariat",
value: "partnership_option",
emoji: "💎",
},
{
label: "Contacter le Staff",
value: "contact_option",
emoji: "✉",
},
{
label: "Report un utilisateur",
value: "report_option",
emoji: "📣",
},
]),
); // Never gonna give you up :D

View File

@ -1,92 +0,0 @@
import {
PermissionFlagsBits,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
EmbedBuilder,
ChannelType,
} from "discord.js";
export default {
async execute(interaction, client) {
interaction.deferReply({ ephemeral: true });
const embedToSend = interaction.message.embeds[0];
const userId = interaction.customId.replace("applicationopen_", "");
const member = await interaction.guild.members.fetch(userId);
await interaction.guild.channels
.create({
name: `candidature-${member.user.username}`,
type: ChannelType.GuildText,
parent: "916721453121040424",
permissionOverwrites: [
{
id: userId,
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: "778016554066640896",
allow: [PermissionFlagsBits.ViewChannel],
},
],
reason: `April - Tickets candidatures - ${interaction.user.id}'`,
topic: `Candidature de <@${userId}>\nID: ${userId}\nDate de la candidature: <t:${Math.floor(
Date.now() / 1000,
)}:f>`,
})
.then(async (channel) => {
const btnrowTicket = new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setLabel("Fermer le ticket")
.setStyle(ButtonStyle.Danger)
.setEmoji("🔒")
.setCustomId(`ticket_close-${userId}`),
]);
const commandEmbed = new EmbedBuilder()
.setColor(`#7961fd`)
.setTitle("Candidature")
.setDescription(
"Veuillez patienter, un membre du staff consultera votre candidature sous peu !\n> En cas de candidature troll, non sérieuse, etc, vous pouvez être sujet à des sanctions !",
);
await channel
.send({
content:
"Bienvenue <@" +
userId +
"> ! Ce salon est là pour discuter de ta candidature !",
embeds: [commandEmbed],
components: [btnrowTicket],
})
.then((msg) => msg.pin());
const openedapplicationticket =
new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setCustomId("applicationopened")
.setLabel("Ticket ouvert")
.setStyle(ButtonStyle.Primary)
.setDisabled(true)
.setEmoji("🎫"),
);
await channel
.send({ embeds: [embedToSend] })
.then((msg) => msg.pin());
await interaction.followUp({
content: `Candidature ouverte dans <#${channel.id}>`,
ephemeral: true,
});
await interaction.message.edit({
content: `Candidature ouverte dans <#${channel.id}>`,
components: [openedapplicationticket],
});
})
.catch(console.error);
},
};

View File

@ -1,121 +0,0 @@
import {
ModalBuilder,
ActionRowBuilder,
TextInputBuilder,
TextInputStyle,
} from "discord.js";
export default {
async execute(interaction, client) {
switch (interaction.customId) {
case "apply_staff":
await interaction.showModal(staffapplication);
break;
case "apply_artist":
await interaction.showModal(artistapplication);
break;
}
},
};
const staffapplication = new ModalBuilder()
.setCustomId("application_staff")
.setTitle("Art'Portal - Candidature")
.addComponents(
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("application_motivation")
.setLabel("Expliquez vos motivations")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(300)
.setMaxLength(1000)
.setPlaceholder(
"Ex: Cela me permettrait de m'enrichir culturellement",
)
.setRequired(true),
),
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("application_aptitudes")
.setLabel("Vos aptitudes")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(300)
.setMaxLength(1000)
.setPlaceholder("En modération, en diplomatie...")
.setRequired(true),
),
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("application_presentation")
.setLabel("Présentez-vous")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(300)
.setMaxLength(1000)
.setPlaceholder(
"Présentez-vous, votre expérience, vos attentes...",
)
.setRequired(true),
),
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("application_disponibilites")
.setLabel("Vos disponibilités")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(20)
.setMaxLength(1000)
.setPlaceholder(
"Ex: Le lundi de 16 à 20h, le dimanche toute la journée...",
)
.setRequired(true),
),
);
const artistapplication = new ModalBuilder()
.setCustomId("application_artist")
.setTitle("Art'Portal - Candidature Artiste")
.addComponents(
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("application_motivation")
.setLabel("Expliquez vos motivations")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(300)
.setMaxLength(1000)
.setPlaceholder(
"Ex: Cela me permettrait de m'enrichir culturellement",
)
.setRequired(true),
),
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("application_aptitudes")
.setLabel("Vos aptitudes")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(300)
.setMaxLength(1000)
.setPlaceholder("En modération, en diplomatie...")
.setRequired(true),
),
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("application_presentation")
.setLabel("Présentez-vous")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(300)
.setMaxLength(1000)
.setPlaceholder(
"Présentez-vous, votre expérience, vos attentes...",
)
.setRequired(true),
),
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("application_examples")
.setLabel("Exemples de créations")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(20)
.setMaxLength(1000)
.setPlaceholder("(Liens vers les créations)")
.setRequired(true),
),
);

View File

@ -1,325 +0,0 @@
import {
PermissionFlagsBits,
ButtonBuilder,
ButtonStyle,
ActionRowBuilder,
EmbedBuilder,
} from "discord.js";
export default {
async execute(interaction, client) {
await interaction.deferUpdate({ ephemeral: true });
switch (interaction.customId.replace("ticket_", "").split("-")[0]) {
case "close":
await interaction.channel.permissionOverwrites.set([
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: "778016554066640896",
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.ManageChannels,
],
},
]);
const closebuttons = new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setCustomId(
`ticket_reopen-${
interaction.customId
.replace("ticket_", "")
.split("-")[1]
}`,
)
.setEmoji("🔐")
.setLabel("Rouvrir le ticket")
.setStyle(ButtonStyle.Success),
new ButtonBuilder()
.setCustomId(`ticket_delete`)
.setEmoji("🗑️")
.setLabel("Supprimer le ticket")
.setStyle(ButtonStyle.Danger),
]);
const closeEmbed = new EmbedBuilder()
.setTitle("Art'Portal - Tickets")
.setDescription(
`Le ticket a été fermé par <@${interaction.user.id}>`,
)
.setColor("#ce0808");
await interaction.editReply({ components: [closebuttons] });
await interaction.followUp({ embeds: [closeEmbed] });
break;
case "delete":
if (!interaction.member.roles.cache.has("778016554066640896"))
return interaction.reply({
content: "Tu n'a pas la permission de faire ça!",
ephemeral: true,
});
var ticketRowDelete = new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setLabel("Oui")
.setStyle(ButtonStyle.Success)
.setEmoji("✔")
.setCustomId("ticket_confirmDelete"),
new ButtonBuilder()
.setLabel("Non")
.setStyle(ButtonStyle.Danger)
.setEmoji("❌")
.setCustomId("ticket_cancelDelete"),
);
interaction.editReply({});
interaction.followUp({
content: "Êtes-vous sûr de vouloir supprimer ce ticket ?",
components: [ticketRowDelete],
});
break;
case "confirmDelete":
if (!interaction.member.roles.cache.has("778016554066640896"))
return interaction.reply({
content: "Tu n'a pas la permission de faire ça!",
ephemeral: true,
});
await interaction.editReply({
content: "Le ticket va être supprimé dans 5 secondes !",
components: [],
});
const logchannel = await interaction.guild.channels.fetch(
"1036589658647314502",
);
await logchannel.send({
content: `${interaction.channel.name} fermé par <@${interaction.user.id}> (${interaction.user.id})`,
});
setTimeout(() => {
interaction.guild.channels.delete(
interaction.channel.id,
`Ticket supprimé par ${interaction.user.tag} (${interaction.user.id})`,
);
}, 5000);
break;
case "cancelDelete":
if (!interaction.member.roles.cache.has("778016554066640896"))
return interaction.reply({
content: "Tu n'a pas la permission de faire ça!",
ephemeral: true,
});
await interaction.editReply({
content: "Annulation de la suppression !",
components: [],
});
setTimeout(() => {
interaction.message.delete();
}, 5000);
break;
case "reopen":
await interaction.channel.permissionOverwrites.set([
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.customId
.replace("ticket_", "")
.split("-")[1],
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: "778016554066640896",
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.ManageChannels,
],
},
]);
if (
["1040706105321467934", "780559502105378836"].includes(
interaction.channel.parentId,
)
) {
await interaction.channel.permissionOverwrites.create(
"780007193688801321",
{
ViewChannel: true,
},
);
await interaction.channel.permissionOverwrites.create(
"778016552108556388",
{
ViewChannel: true,
},
);
}
const btnrowTicket = new ActionRowBuilder();
if (interaction.channel.parentId == "780559502105378836")
btnrowTicket.addComponents(
new ButtonBuilder()
.setLabel("Prendre en charge")
.setStyle(ButtonStyle.Success)
.setEmoji("✏")
.setCustomId(
`ticket_takeCommand-${
interaction.customId
.replace("ticket_", "")
.split("-")[1]
}`,
),
);
btnrowTicket.addComponents([
new ButtonBuilder()
.setLabel("Fermer le ticket")
.setStyle(ButtonStyle.Danger)
.setEmoji("🔒")
.setCustomId(
`ticket_close-${
interaction.customId
.replace("ticket_", "")
.split("-")[1]
}`,
),
]);
const reopenEmbed = new EmbedBuilder()
.setTitle("Art'Portal - Tickets")
.setDescription(
`Le ticket a été rouvert par <@${interaction.user.id}>`,
)
.setColor("#34f213");
await interaction.editReply({ components: [btnrowTicket] });
await interaction.followUp({ embeds: [reopenEmbed] });
break;
case "takeCommand":
const ticketRowTaken = new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setLabel("Annuler la prise en charge")
.setStyle(ButtonStyle.Danger)
.setEmoji("❌")
.setCustomId(
`ticket_cancelTakenCommand-${interaction.user.id}-${
interaction.customId
.replace("ticket_", "")
.split("-")[1]
}`,
),
new ButtonBuilder()
.setLabel("Fermer le ticket")
.setStyle(ButtonStyle.Danger)
.setEmoji("🔒")
.setCustomId(
`ticket_close-${
interaction.customId
.replace("ticket_", "")
.split("-")[1]
}`,
),
]);
const artist = await client.database.artists.findOne({
where: { name: interaction.user.id },
});
interaction.channel.setName(
(artist ? artist.emoji : "🟢") + interaction.channel.name,
);
await interaction.followUp({
embeds: [
new EmbedBuilder()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.avatarURL(),
})
.setDescription(
`<@${interaction.user.id}> prend en charge le ticket !\nMerci à elle/lui !`,
)
.setColor("#34f213"),
],
});
await interaction.editReply({ components: [ticketRowTaken] });
break;
case "cancelTakenCommand":
let untakeMessage;
if (
interaction.user.id ==
interaction.customId.replace("ticket_", "").split("-")[1]
)
untakeMessage = "(Annulation par l'artiste)";
else if (
interaction.member.permissions.has(
PermissionFlagsBits.Administrator,
)
)
untakeMessage = "(Annulation par le staff)";
else {
await interaction.editReply();
return interaction.followUp({
content: `Vous n'avez pas la permission de faire ça !`,
ephemeral: true,
});
}
const ticketRowUntaken = new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setLabel("Prendre en charge")
.setStyle(ButtonStyle.Success)
.setEmoji("✏")
.setCustomId(
`ticket_takeCommand-${
interaction.customId
.replace("ticket_", "")
.split("-")[2]
}`,
),
new ButtonBuilder()
.setLabel("Fermer le ticket")
.setStyle(ButtonStyle.Danger)
.setEmoji("🔒")
.setCustomId(
`ticket_close-${
interaction.customId
.replace("ticket_", "")
.split("-")[2]
}`,
),
]);
const artistUntake = await client.database.artists.findOne({
where: { name: interaction.user.id },
});
interaction.channel.setName(
interaction.channel.name.replace(
artistUntake ? artistUntake.emoji : "🟢",
"",
),
);
await interaction.followUp({
embeds: [
new EmbedBuilder()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.avatarURL(),
})
.setDescription(
`<@${
interaction.customId
.replace("ticket_", "")
.split("-")[1]
}> ne prend plus en charge le ticket ! ${untakeMessage}`,
)
.setColor("#ce0808"),
],
});
await interaction.editReply({ components: [ticketRowUntaken] });
break;
}
},
};

View File

@ -1,89 +0,0 @@
import {
ActionRowBuilder,
StringSelectMenuBuilder,
EmbedBuilder,
} from "discord.js";
export default {
async execute(interaction) {
await interaction.deferReply({ ephemeral: true });
if (interaction.customId.endsWith("free")) {
if (
!interaction.member.roles.cache.has("1104145272499621928") &&
!interaction.member.roles.cache.has("1104146176627970249") &&
!interaction.member.roles.cache.has("1104146641721761843") &&
!interaction.member.roles.cache.has("1104147264500400142")
)
return interaction.editReply({ embeds: [hasNotRoleEMBED] });
}
const ticketgraphismtyperow2 = new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId(
`ticket_create-graphism-${interaction.customId.replace(
"ticketopener_",
"",
)}`,
)
.setPlaceholder("Choisissez le type de graphisme.")
.addOptions([
{
label: "Logo/Logo",
value: "ticket_logo",
emoji: "🖼",
},
{
label: "Bannière/Banner (Discord)",
value: "ticket_discordbanner",
emoji: "🧩",
},
{
label: "Bannière/Banner (Youtube/Twitch)",
value: "ticket_ytbbanner",
emoji: "🧩",
},
{
label: "Dessin/Drawing",
value: "ticket_drawing",
emoji: "✏",
},
{
label: "Photo de profil/Profile picture",
value: "ticket_profilepicture",
emoji: "🎆",
},
{
label: "Overlay/Overlay",
value: "ticket_overlay",
emoji: "🎥",
},
{
label: "Emojis/Emotes",
value: "ticket_emojis",
emoji: "😀",
},
{
label: "Miniature/Thumbnail",
value: "ticket_minia",
emoji: "🪟",
},
{
label: "Montage/Editing",
value: "ticket_editing",
emoji: "🎬",
},
{
label: "Autre/Other",
value: "ticket_other",
emoji: "🎈",
},
]),
);
await interaction.editReply({ components: [ticketgraphismtyperow2] });
},
};
const hasNotRoleEMBED = new EmbedBuilder()
.setTitle("Désolé !")
.setColor("#db2a06")
.setDescription(
"Pour pouvoir ouvrir un ticket bénévole, vous devez avoir le rôle <@&1104145272499621928> !\nCela nous permet de ne pas être noyés sous les commandes tout en laissant l'accès aux commandes bénévole possible.!",
);

View File

@ -63,6 +63,17 @@ export default {
components: message.components,
});
});
const member =
await interaction.guild.members.cache.get(userId);
try {
if (member) {
await member.send({
content:
"Vous avez reçu une sanction sur Art'Portal !",
embeds: [blacklistEMBED],
});
}
} catch (error) {}
break;
case "blacklist_remove":
if (blacklistuser) {

View File

@ -1,107 +0,0 @@
import {
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
} from "discord.js";
import config from "../../../../config.json" assert { type: "json" };
const { progressBar } = config;
export default {
async execute(interaction, client) {
await interaction.reply({
content: `${progressBar}\nCréation de la candidature en cours, merci de patienter !`,
ephemeral: true,
});
const motivation = interaction.fields.getTextInputValue(
"application_motivation",
);
const aptitudes = interaction.fields.getTextInputValue(
"application_aptitudes",
);
const presentation = interaction.fields.getTextInputValue(
"application_presentation",
);
let disponibilites = undefined;
try {
disponibilites = interaction.fields.getTextInputValue(
"application_disponibilites",
);
} catch {}
let examples = undefined;
try {
examples = interaction.fields.getTextInputValue(
"application_examples",
);
} catch {}
const applicationchannel = client.channels.cache.find(
(channel) =>
channel.id ===
`${
disponibilites ? "934898908407144469" : "950124391159697540"
}`,
);
const applicationEMBED = new EmbedBuilder()
.setColor(`#7961fd`)
.setTitle("Art'Portal - Candidature")
.addFields(
{
name: "・Candidat.e・",
value: `**Tag: ${interaction.user.tag}\nID: ${interaction.user.id}**`,
inline: true,
},
{
name: "・Motivation・",
value: `${motivation}`,
inline: false,
},
{
name: `・Aptitudes・`,
value: `${aptitudes}`,
inline: false,
},
{
name: `・Présentation・`,
value: `${presentation}`,
inline: false,
},
{
name: `${
disponibilites
? "Disponibilité"
: "Exemples de créations"
}`,
value: `${disponibilites ? disponibilites : examples}`,
inline: false,
},
{
name: `・Date de la candidature・`,
value: `<t:${Math.floor(new Date().getTime() / 1000)}:D>`,
inline: true,
},
);
const openapplicationticket = new ButtonBuilder()
.setCustomId("applicationopen_" + interaction.user.id)
.setLabel("Ouvrir un ticket")
.setStyle(ButtonStyle.Success)
.setEmoji("🎫");
const applicationrow = new ActionRowBuilder().addComponents([
openapplicationticket,
]);
applicationchannel.send({
embeds: [applicationEMBED],
components: [applicationrow],
});
setTimeout(async function () {
await interaction.editReply({
content: "Votre candidature a bien été envoyée au staff !",
embeds: [applicationEMBED],
ephemeral: true,
});
}, 5000);
},
};

View File

@ -1,236 +0,0 @@
import {
PermissionFlagsBits,
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
ChannelType,
ButtonStyle,
ThreadAutoArchiveDuration,
} from "discord.js";
import config from "../../../../config.json" assert { type: "json" };
const { progressBar } = config;
export default {
async execute(interaction, client) {
await interaction.reply({
content: `${progressBar}\nCréation du ticket en cours, merci de patienter !`,
ephemeral: true,
});
let remuneration;
try {
remuneration = interaction.fields.getTextInputValue(
"command_remuneration",
);
} catch {
remuneration = null;
}
const commandType =
cmdTypeDict[interaction.customId.replace("command_", "")];
const theme = interaction.fields.getTextInputValue("command_theme");
const desc = interaction.fields.getTextInputValue(
"command_description",
);
const top = interaction.fields.getTextInputValue("command_toppings");
const baseimg =
interaction.fields.getTextInputValue("command_baseimage");
const commandtosendEMBED = new EmbedBuilder()
.setColor(`#7961fd`)
.setTitle(
`__Formulaire de commande Art' Portal__ (${
remuneration ? "Rémunéré" : "Non rémunéré"
})`,
)
.addFields(
{
name: "・Type de graphisme・",
value: `${commandType ? commandType : "Non spécifié"}`,
inline: false,
},
{
name: "・Thème imposé・",
value: `${theme ? theme : "Non spécifié"}`,
inline: false,
},
{
name: `・Description de l'image・`,
value: `${desc ? desc : "Non spécifié"}`,
inline: false,
},
{
name: `・Effets, détails, texte à ajouter・`,
value: `${top ? top : "Non spécifié"}`,
inline: false,
},
{
name: `・Image(s) de Base・`,
value: `${baseimg ? baseimg : "Non spécifié"}`,
inline: false,
},
);
if (remuneration) {
commandtosendEMBED.addFields({
name: "Budget",
value: String(remuneration),
inline: false,
});
}
const isalreadybl = await client.database.blacklistdb.findOne({
where: { name: interaction.user.id },
});
if (isalreadybl) {
const bllogchannel = await interaction.guild.channels.fetch(
"1036589658647314502",
);
await bllogchannel.send({
content: `<:Z_UtileDanger:962499193862225940>**Utilisateur blacklisté** (Raison: ${isalreadybl.get(
"reason",
)})<:Z_UtileDanger:962499193862225940>\nCommande de : <@${
interaction.user.id
}> (${
interaction.user.id
})\nCréation de la commande : <t:${Math.floor(
Date.now() / 1000,
)}:f>`,
embeds: [commandtosendEMBED],
});
}
if (isalreadybl)
return interaction.editReply({
content:
"Vous avez été blacklisté des tickets sur le serveur pour la raison: `" +
isalreadybl.get("reason") +
"`\nPour contester cette décision, vous pouvez ouvrir un ticket dans le salon <#869093817503076363>",
ephemeral: true,
});
await interaction.guild.channels
.create({
name:
`${remuneration ? "rémunéré" : "bénévole"} - ` +
interaction.user.username,
type: ChannelType.GuildText,
parent: remuneration
? "1040706105321467934"
: "780559502105378836",
permissionOverwrites: [
{
id: interaction.user.id,
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.ViewChannel],
allow: [PermissionFlagsBits.SendMessagesInThreads],
},
{
id: "778016554066640896",
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.ManageChannels,
],
},
{
id: "780007193688801321",
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: "778016552108556388",
allow: [PermissionFlagsBits.ViewChannel],
},
],
reason: `April - Tickets commandes - ${interaction.user.username} (${interaction.user.id})'`,
topic: `${commandType} pour <@${interaction.user.id}>\nID: ${
interaction.user.id
}\nDate de la commande: <t:${Math.floor(Date.now() / 1000)}:f>`,
})
.then(async (channel) => {
var btnrowTicket = new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setLabel("Prendre en charge")
.setStyle(ButtonStyle.Success)
.setEmoji("✏")
.setCustomId(
"ticket_takeCommand-" + interaction.user.id,
),
new ButtonBuilder()
.setLabel("Fermer le ticket")
.setStyle(ButtonStyle.Danger)
.setEmoji("🔒")
.setCustomId(`ticket_close-${interaction.user.id}`),
]);
const commandEmbed = new EmbedBuilder()
.setColor(`#7961fd`)
.setTitle("Commande: " + commandType)
.setDescription(
"Un artiste viendra prendre votre commande bientôt !\n> :x: Si l'artiste ne reçoit aucune réponse pendant plusieurs jours de suite, le ticket sera fermé/mis en attente. Merci également de faire l'entièreté de la commande sur ce ticket et de ne pas partir en mp.\n> Si vous quittez le serveur avec ce ticket ouvert, vous serez blacklist: vous ne pourrez pas repasser commande.\n> En cas d'irrespect ou de manquement au <#766336361984294913>, votre ticket sera fermé et vous serez blacklist, sans sommation.",
);
await channel
.send({
content:
"Bienvenue <@" +
interaction.user.id +
"> !\nPortal'Artistes, un ticket a été ouvert!",
embeds: [commandEmbed],
components: [btnrowTicket],
})
.then((msg) => msg.pin());
await channel
.send({ embeds: [commandtosendEMBED] })
.then((msg) => msg.pin());
setTimeout(async function () {
await interaction.editReply({
content:
"Ton ticket a bien été créé ! (<#" +
channel.id +
">)",
ephemeral: true,
});
}, 5000);
if (remuneration) {
await channel.threads.create({
name: "Portfolios",
autoArchiveDuration: ThreadAutoArchiveDuration.OneWeek,
message: {
content: `Commande de ${interaction.user.tag} (${interaction.user.id})`,
},
reason: `April - Portfolios - Commande de ${interaction.user.tag} (${interaction.user.id})`,
});
}
const logchannel = await interaction.guild.channels.fetch(
"1036589658647314502",
);
await logchannel.send({
content: `Commande de : <@${interaction.user.id}> (${
interaction.user.id
})\nCréation de la commande : <t:${Math.floor(
Date.now() / 1000,
)}:f>`,
embeds: [commandtosendEMBED],
});
})
.catch(console.error);
},
};
const cmdTypeDict = {
logo: "Logo",
discordbanner: "Bannière Discord",
ytbbanner: "Bannière Youtube/...",
drawing: "Dessin",
profilepicture: "Photo de profil",
overlay: "Overlay de stream",
emojis: "Émojis/Stickers",
minia: "Miniature",
editing: "Montage",
other: "Autre",
};

View File

@ -1,161 +0,0 @@
import {
PermissionFlagsBits,
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
ChannelType,
ButtonStyle,
} from "discord.js";
import config from "../../../../config.json" assert { type: "json" };
const { progressBar } = config;
export default {
async execute(interaction) {
await interaction.reply({
content: `${progressBar}\nCréation du ticket en cours, merci de patienter !`,
ephemeral: true,
});
const invite = interaction.fields.getTextInputValue(
"partnership_servinvite",
);
const description =
interaction.fields.getTextInputValue("partnership_servdesc") ||
"Pas de description renseignée";
await interaction.guild.channels
.create({
name: `partenariat-${interaction.user.username}`,
type: ChannelType.GuildText,
parent: "847188286043717632",
permissionOverwrites: [
{
id: interaction.user.id,
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: "778016554066640896",
allow: [PermissionFlagsBits.ViewChannel],
},
],
reason: `April - Tickets partenariat - ${interaction.user.username} (${interaction.user.id})'`,
topic: `Partenariat avec <@${
interaction.user.id
}>\nLien: ${invite}\nID: ${
interaction.user.id
}\nDate de la proposition: <t:${Math.floor(
Date.now() / 1000,
)}:f>`,
})
.then(async (channel) => {
var btnrowTicket = new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setLabel("Fermer le ticket")
.setStyle(ButtonStyle.Danger)
.setEmoji("🔒")
.setCustomId(`ticket_close-${interaction.user.id}`),
]);
const partnershipEmbed = new EmbedBuilder()
.setColor(`#7961fd`)
.setTitle("Partenariat")
.setDescription(
"Un membre du staff viendra bientôt !\n> Votre serveur doit avoir minimum 200 membres !\n> Il doit également respecter les [ToS de discord](https://discord.com/terms)",
);
await channel
.send({
content:
"Bienvenue <@" +
interaction.user.id +
"> !\n<@&778016554066640896> un ticket a été ouvert!",
embeds: [partnershipEmbed],
components: [btnrowTicket],
})
.then((msg) => msg.pin());
const commandtosendEMBED = new EmbedBuilder()
.setColor(`#7961fd`)
.setTitle(`__Formulaire de partenariat Art' Portal__`)
.addFields(
{
name: "・Lien vers le serveur / site・",
value: `${invite}`,
inline: false,
},
{
name: "・Description・",
value: `\`\`\`${description}\`\`\``,
inline: false,
},
);
await channel
.send({ embeds: [commandtosendEMBED] })
.then((msg) => msg.pin());
if (invite.includes("discord.gg/")) {
await interaction.client
.fetchInvite(invite)
.then(async (Sinvite) => {
const servinfoEMBED = new EmbedBuilder()
.setTitle(Sinvite.guild.name)
.setFields([
{
name: "Créé :",
value: `<t:${Math.round(
Sinvite.guild.createdTimestamp /
1000,
)}>`,
},
{
name: "Membres :",
value: Sinvite.memberCount.toString(),
},
{
name: "Description :",
value:
Sinvite.guild.description ||
"Aucune",
},
{
name: "ID :",
value: Sinvite.guild.id.toString(),
},
{
name: "Nombre de boosts :",
value: Sinvite.guild.premiumSubscriptionCount.toString(),
},
])
.setImage(Sinvite.guild.bannerURL())
.setThumbnail(
Sinvite.guild.iconURL({ size: 1024 }),
);
if (Sinvite.guild.partnered)
servinfoEMBED.setDescription(
"<:Z_UtilePartner:962499238783242271>",
);
await channel.send({
content: invite,
embeds: [servinfoEMBED],
});
})
.catch((error) => {
console.error(error);
});
}
setTimeout(async function () {
await interaction.editReply({
content:
"Ton ticket a bien été créé ! (<#" +
channel.id +
">)",
ephemeral: true,
});
}, 5000);
})
.catch(console.error);
},
};

View File

@ -1,113 +0,0 @@
import {
PermissionFlagsBits,
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
ChannelType,
ButtonStyle,
} from "discord.js";
import config from "../../../../config.json" assert { type: "json" };
const { progressBar } = config;
export default {
async execute(interaction) {
await interaction.reply({
content: `${progressBar}\nCréation du ticket en cours, merci de patienter !`,
ephemeral: true,
});
const reason = interaction.fields.getTextInputValue("reason");
const messageslink =
interaction.fields.getTextInputValue("messageslink") ||
"Pas de message renseigné";
const screens =
interaction.fields.getTextInputValue("screens") ||
"Pas de capture d'écran renseignée";
await interaction.guild.channels
.create({
name: `report-${interaction.user.username}`,
type: ChannelType.GuildText,
parent: "916721453121040424",
permissionOverwrites: [
{
id: interaction.user.id,
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: "778016554066640896",
allow: [PermissionFlagsBits.ViewChannel],
},
],
reason: `April - Tickets report - ${interaction.user.username} (${interaction.user.id})'`,
topic: `Report de <@${interaction.user.id}>\nID: ${
interaction.user.id
}\nDate du report: <t:${Math.floor(Date.now() / 1000)}:f>`,
})
.then(async (channel) => {
var btnrowTicket = new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setLabel("Fermer le ticket")
.setStyle(ButtonStyle.Danger)
.setEmoji("🔒")
.setCustomId(`ticket_close-${interaction.user.id}`),
]);
const reportEmbed = new EmbedBuilder()
.setColor(`#7961fd`)
.setTitle("Report")
.setDescription(
"Un membre du staff viendra bientôt !\n> En cas de report troll, vous serez sanctionné vous-même !",
);
await channel
.send({
content:
"Bienvenue <@" +
interaction.user.id +
"> !\n<@&778016554066640896> un ticket a été ouvert!",
embeds: [reportEmbed],
components: [btnrowTicket],
})
.then((msg) => msg.pin());
const commandtosendEMBED = new EmbedBuilder()
.setColor(`#7961fd`)
.setTitle(`__Formulaire de report Art' Portal__`)
.addFields(
{
name: "・Raison・",
value: `${reason}`,
inline: false,
},
{
name: "・Lien(s) vers un/des message(s)・",
value: `${messageslink}`,
inline: false,
},
{
name: "・Lien(s) vers un/des capture(s) d'écran・",
value: `${screens}`,
inline: false,
},
);
await channel
.send({ embeds: [commandtosendEMBED] })
.then((msg) => msg.pin());
setTimeout(async function () {
await interaction.editReply({
content:
"Ton ticket a bien été créé ! (<#" +
channel.id +
">)",
ephemeral: true,
});
}, 5000);
})
.catch(console.error);
},
};

View File

@ -1,260 +0,0 @@
import {
ActionRowBuilder,
EmbedBuilder,
ButtonBuilder,
ButtonStyle,
ModalBuilder,
TextInputBuilder,
TextInputStyle,
PermissionFlagsBits,
ChannelType,
} from "discord.js";
export default {
async execute(interaction) {
switch (interaction.customId.split("-")[1]) {
case "graphism":
const commandType =
cmdTypeDict[interaction.values[0].replace("ticket_", "")];
const remuneration = interaction.customId.split("-")[2];
const commandmodal = new ModalBuilder()
.setCustomId(
"command_" +
interaction.values[0].replace("ticket_", ""),
)
.setTitle("Art'Portal - Commande - " + commandType)
.addComponents([
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("command_theme")
.setLabel("Thème")
.setStyle(TextInputStyle.Short)
.setMinLength(10)
.setMaxLength(1000)
.setPlaceholder(
"(Exemple: Futuriste, Fantaisie, Naturel, Etc...)",
)
.setRequired(true),
]),
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("command_description")
.setLabel("Description")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(150)
.setMaxLength(1000)
.setPlaceholder(
"(Décrivez votre demande afin de faciliter le travail du graphiste. Soyez le plus précis possible!)",
)
.setRequired(true),
]),
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("command_toppings")
.setLabel("Effets/Détails/Texte à ajouter")
.setStyle(TextInputStyle.Paragraph)
.setMaxLength(1000)
.setPlaceholder(
"(Écrivez votre texte sans oublier les majuscules, minuscules, accent, etc...)",
)
.setRequired(false),
]),
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("command_baseimage")
.setLabel(
"Image(s) de Base, Exemples (mettez des liens)",
)
.setStyle(TextInputStyle.Paragraph)
.setMaxLength(1000)
.setPlaceholder(
"Proposer des exemples aidera beaucoup les artistes à comprendre ce que vous voulez",
)
.setRequired(false),
]),
]);
if (remuneration == "paid") {
commandmodal.addComponents([
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("command_remuneration")
.setLabel("Votre budget")
.setStyle(TextInputStyle.Short)
.setMinLength(1)
.setMaxLength(30)
.setPlaceholder(
"Indiquez le budget que vous avez pour la rémunération de cette commande",
)
.setRequired(true),
]),
]);
}
await interaction.showModal(commandmodal);
break;
case "support":
switch (interaction.values[0].replace("_option", "")) {
case "partnership":
const partnershipmodal = new ModalBuilder()
.setCustomId("partnershipmodal")
.setTitle("Art'Portal - Partenariats")
.addComponents([
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("partnership_servinvite")
.setLabel("Invitation / Lien")
.setStyle(TextInputStyle.Short)
.setMaxLength(35)
.setPlaceholder(
"Invitation / Lien de votre organisme",
)
.setRequired(true),
]),
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("partnership_servdesc")
.setLabel("Description")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(10)
.setMaxLength(1000)
.setPlaceholder(
"Décrivez votre serveur / organisation si ce n'est pas un serveur",
)
.setRequired(false),
]),
]);
interaction.showModal(partnershipmodal);
break;
case "contact":
await interaction.guild.channels
.create({
name: `ticket-${interaction.user.username}`,
type: ChannelType.GuildText,
permissionOverwrites: [
{
id: interaction.user.id,
allow: [
PermissionFlagsBits.ViewChannel,
],
},
],
reason: "April - Tickets - Contact du staff",
})
.then(async (channel) => {
let category =
interaction.guild.channels.cache.find(
(cat) =>
cat.id === "916721453121040424",
);
await channel.setParent(category.id);
await channel.permissionOverwrites.create(
interaction.user,
{ ViewChannel: true },
);
var btnrowTicket =
new ActionRowBuilder().addComponents([
new ButtonBuilder()
.setLabel("Fermer le ticket")
.setStyle(ButtonStyle.Danger)
.setEmoji("🔒")
.setCustomId(
`ticket_close-${interaction.user.id}`,
),
]);
const commandEmbed = new EmbedBuilder()
.setColor(`#7961fd`)
.setDescription(
"*Merci de patienter un peu*",
);
await channel
.send({
content:
"Bienvenue <@" +
interaction.user.id +
">\n<@&778016554066640896> un ticket a été ouvert!",
embeds: [commandEmbed],
components: [btnrowTicket],
})
.then((msg) => msg.pin());
await interaction.reply({
content:
"Ton ticket a bien été créé ! (<#" +
channel.id +
">)",
ephemeral: true,
});
})
.catch(console.error);
break;
case "report":
const reportmodal = new ModalBuilder()
.setCustomId("reportmodal")
.setTitle("Art'Portal - Report")
.addComponents(
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("reason")
.setLabel("Raison du report")
.setStyle(TextInputStyle.Paragraph)
.setMinLength(10)
.setMaxLength(1000)
.setPlaceholder(
`Merci d'indiquer également le pseudo de la personne !`,
)
.setRequired(true),
]),
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("messageslink")
.setLabel(
"Liens vers les messages (facultatif)",
)
.setStyle(TextInputStyle.Paragraph)
.setMinLength(10)
.setMaxLength(1000)
.setPlaceholder(
`Vous pouvez mettre des liens de messages problématiques. (facultatif mais peut aider)`,
)
.setRequired(false),
]),
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("screens")
.setLabel(
"Captures d'écran (facultatives)",
)
.setStyle(TextInputStyle.Paragraph)
.setMinLength(10)
.setMaxLength(1000)
.setPlaceholder(
`Vous pouvez mettre des liens vers des captures d'écran.`,
)
.setRequired(false),
]),
);
interaction.showModal(reportmodal);
break;
}
break;
}
},
};
const cmdTypeDict = {
logo: "Logo",
discordbanner: "Bannière Discord",
ytbbanner: "Bannière Youtube/...",
drawing: "Dessin",
profilepicture: "Photo de profil",
overlay: "Overlay de stream",
emojis: "Émojis/Stickers",
minia: "Miniature",
editing: "Montage",
other: "Autre",
};