44 lines
1.7 KiB
JavaScript
44 lines
1.7 KiB
JavaScript
const { SlashCommandBuilder, AttachmentBuilder, EmbedBuilder } = require('discord.js');
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('mod')
|
|
.setDescription('Get a mod file from a specific game.')
|
|
.addStringOption(option =>
|
|
option
|
|
.setName('mod')
|
|
.setDescription('Télécharger le fichier moddé d\'un jeu')
|
|
.setRequired(true)
|
|
.addChoices(
|
|
{ name: 'Minecraft', value: 'mods/minecraft.zip' },
|
|
{ name: 'Valheim', value: 'mods/valheim.r2z' },
|
|
{ name: 'Lethal Company', value: 'mods/lethal.r2z' },
|
|
),),
|
|
async execute(interaction) {
|
|
await interaction.deferReply();
|
|
|
|
const mod = interaction.options.getString('mod') ?? 'default';
|
|
|
|
if (mod == 'default'){
|
|
interaction.editReply('Désolé, je ne connais pas ce jeu !')
|
|
}
|
|
|
|
const file = new AttachmentBuilder(mod);
|
|
|
|
if (mod.split('.')[mod.split('.').length - 1] == 'r2z') {
|
|
tuto = '1. Installer r2modman\n2. Sélectionne le jeu dans la liste\n3.Importe un nouveau profil via fichier\n4. Sélectionne le fichier téléchargé puis lance le jeu en Modded !'
|
|
} else {
|
|
tuto = '1. Installer CurseForge\n2. Créer un nouveau profil puis utiliser le fichier téléchargé pour importer les mods\n3. Lancer le profil puis lancer Minecraft via le Launcher lancé.'
|
|
}
|
|
|
|
interaction.editReply({ embeds:
|
|
[
|
|
new EmbedBuilder().setTitle('Fichier à importer')
|
|
.addFields(
|
|
{ name: 'Installation', value: tuto}
|
|
)
|
|
], files: [file]
|
|
})
|
|
},
|
|
};
|