diff --git a/data/commands.json b/data/commands.json index 4db92eb..14f9c71 100644 --- a/data/commands.json +++ b/data/commands.json @@ -302,6 +302,14 @@ "name": "devtest", "description": "[BOT OWNER ONLY] Test the bot with a sample message", "default_member_permissions": 0, - "type": 1 + "type": 1, + "options": [ + { + "name": "randstr", + "description": "override random string in test message for testing", + "type": 3, + "required": false + } + ] } ] \ No newline at end of file diff --git a/index.js b/index.js index 11d466e..7c6a5a0 100644 --- a/index.js +++ b/index.js @@ -1439,6 +1439,8 @@ discord.on("interactionCreate", async (interaction) => { interaction.editReply({ content: output, ephemeral: true }); //2. directly trigger handleDiscord with a fake message for the fake room. + + let randStr = interaction.options.getString("randstr") || Math.random().toString(36).substring(2, 15) handleDiscord(require("./testmsg.json")); output += "Triggered handleDiscord with test message.\n"; interaction.editReply({ content: output, ephemeral: true });