diff --git a/.gitea/workflows/config.yaml b/.gitea/workflows/config.yaml new file mode 100644 index 0000000..d99202e --- /dev/null +++ b/.gitea/workflows/config.yaml @@ -0,0 +1,25 @@ +name: Gitea Discord Bot CI +run-name: ${{ github.actor }} has updated +on: [push] +jobs: + Explore-Gitea-Actions: + runs-on: linux_arm + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - run: cp -r ./* /home/meridian/meridian-bot/ + - run: node /home/meridian/meridian-bot/deploy-commands.js + - run: sudo systemctl stop discord-bot + - run: sudo systemctl start discord-bot + # - name: Build TinaCMS + # env: + # TINA_PUBLIC_CLIENT_ID: ${{ secrets.TINA_PUBLIC_CLIENT_ID }} + # TINA_TOKEN: ${{ secrets.TINA_TOKEN }} + # run: npx tinacms build + #- name: Hugo setup + # uses: peaceiris/actions-hugo@v2 + # with: + # hugo-version: '0.119.0' + # extended: true + #- run: hugo --minify + #- run: touch /var/www/my_webapp/test.md \ No newline at end of file diff --git a/commands/general/mod.js b/commands/general/mod.js new file mode 100644 index 0000000..214d427 --- /dev/null +++ b/commands/general/mod.js @@ -0,0 +1,43 @@ +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] + }) + }, +}; diff --git a/commands/general/roll.js b/commands/general/roll.js index e211638..3b8c3dc 100644 --- a/commands/general/roll.js +++ b/commands/general/roll.js @@ -69,7 +69,6 @@ module.exports = { { name: "Vos jets :", value: resultText }, { name: "Votre résultat est...", value: result.toString() } ) - // .setImage('attachment://'+file) ], files: [file] }); }, diff --git a/commands/general/uploadmod.js b/commands/general/uploadmod.js new file mode 100644 index 0000000..5fbc3cf --- /dev/null +++ b/commands/general/uploadmod.js @@ -0,0 +1,19 @@ +const { SlashCommandBuilder } = require('discord.js'); + +module.exports = { + data: new SlashCommandBuilder() + .setName('uploadmod') + .setDescription('Upload a mod file for a specific game.'), + async execute(interaction) { + await interaction.deferReply(); + + //logic + + interaction.editReply({ embeds: + [ + new EmbedBuilder() + .setTitle("File") + ] + }) + }, +}; \ No newline at end of file diff --git a/mods/lethal.r2z b/mods/lethal.r2z new file mode 100644 index 0000000..f6e2979 Binary files /dev/null and b/mods/lethal.r2z differ diff --git a/mods/minecraft.zip b/mods/minecraft.zip new file mode 100644 index 0000000..718f121 Binary files /dev/null and b/mods/minecraft.zip differ diff --git a/mods/valheim.r2z b/mods/valheim.r2z new file mode 100644 index 0000000..664b2b2 Binary files /dev/null and b/mods/valheim.r2z differ