Add multiple message sending
This commit is contained in:
parent
e106b94cd0
commit
9c9aa113e4
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
10
index.js
10
index.js
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue