Add multiple message sending

This commit is contained in:
Christopher Cookman 2023-05-24 20:35:14 -06:00
parent e106b94cd0
commit 9c9aa113e4
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42
2 changed files with 31 additions and 13 deletions

View file

@ -3,6 +3,14 @@
"name": "send",
"description": "Send a message with it's ID for the config file!",
"type": 1,
"default_member_permissions": 0
"default_member_permissions": 0,
"options": [
{
"name": "count",
"description": "Number of messages to send",
"type": 4,
"required": true
}
]
}
]

View file

@ -331,6 +331,15 @@ client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;
switch (interaction.commandName) {
case "send": // Send a message with it's message ID
// check if integer 'count' exists, if not, set it to 1
if (!interaction.options.getInteger('count')) {
count = 1;
} else {
count = interaction.options.getInteger('count');
}
// Send a message `count` fimes
for (i = 0; i < count; i++) {
interaction.channel.send({
embeds: [{
description: "Please Wait"
@ -346,6 +355,7 @@ client.on('interactionCreate', async interaction => {
content: "Done!"
})
});
}
break;
}
});