Compare commits

...

2 Commits

Author SHA1 Message Date
Yannis Perrot
ad75090e15 Merge branch 'main' of https://git.meridian-corp.org/meridian/meridian-bot
Some checks are pending
Gitea Discord Bot CI / Explore-Gitea-Actions (push) Waiting to run
2024-02-22 17:44:56 +01:00
Yannis Perrot
890c979ee9 mods command + mods files 2024-02-22 17:44:31 +01:00
7 changed files with 87 additions and 1 deletions

View File

@ -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

43
commands/general/mod.js Normal file
View File

@ -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]
})
},
};

View File

@ -69,7 +69,6 @@ module.exports = {
{ name: "Vos jets :", value: resultText }, { name: "Vos jets :", value: resultText },
{ name: "Votre résultat est...", value: result.toString() } { name: "Votre résultat est...", value: result.toString() }
) )
// .setImage('attachment://'+file)
], files: [file] ], files: [file]
}); });
}, },

View File

@ -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")
]
})
},
};

BIN
mods/lethal.r2z Normal file

Binary file not shown.

BIN
mods/minecraft.zip Normal file

Binary file not shown.

BIN
mods/valheim.r2z Normal file

Binary file not shown.