From 1b209c9214b4a6b4959abe14779dfe48a6bddfb5 Mon Sep 17 00:00:00 2001 From: Yannis Perrot Date: Mon, 19 Feb 2024 16:51:01 +0100 Subject: [PATCH] set default roll to 1d20 --- README.md | 19 +++++++++++++++++++ commands/general/roll.js | 5 ++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..10269f2 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# Meridian Bot + +This is a custom discord bot for the Meridian Corp community. Join us @ https://discord.gg/7YrtpSQvca. +The bot is auto-hosted on a physical machine at + +## Features + +- Rolling a or some dice(s) (hell yeah) +- Dofus Almanax offer + +## Future Features + +- Game mod file handling +- Audio Player + +## Authors + +- Yannis P https://git.meridian-corp.org/veko / veko@meridian-corp.org +- Martin G https://git.meridian-corp.org/obsidian / obsidian@meridian-corp.org \ No newline at end of file diff --git a/commands/general/roll.js b/commands/general/roll.js index 0ccaf6d..e211638 100644 --- a/commands/general/roll.js +++ b/commands/general/roll.js @@ -8,13 +8,12 @@ module.exports = { .addStringOption(option => option .setName('jet') - .setDescription('Jet du dé (par ex: 2d6)') - .setRequired(true)), + .setDescription('Jet du dé (par ex: 2d6, par défaut 1d20)')), async execute(interaction) { await interaction.deferReply(); // dice argument - let jet = interaction.options.getString('jet'); + let jet = interaction.options.getString('jet') ?? '1d20'; // REGEX FORMAT DICE RULE (i.e. 4d6, 10d12, 9d10, 10d5...) const diceRule = /^\d+d\d+$/;