mirror of
https://github.com/jcreek/denBot.git
synced 2026-07-13 10:53:45 +00:00
feat(*): Add config option to toggle auto deleting commands
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"maxqueuesize": 4,
|
"maxqueuesize": 4,
|
||||||
"channeldeletetimeinminutes": 20,
|
"channeldeletetimeinminutes": 20,
|
||||||
|
"deletecommandstoggle": false,
|
||||||
"prefix": "!",
|
"prefix": "!",
|
||||||
"token": "NzcwMDQyMDEzMjY5NDkxNzUy.X5Xzgg.kcr_51g95iUvEcYCfbQvG1Sx8ao"
|
"token": "NzcwMDQyMDEzMjY5NDkxNzUy.X5Xzgg.kcr_51g95iUvEcYCfbQvG1Sx8ao"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,9 @@ client.on('message', function (message) {
|
|||||||
// Join the queue
|
// Join the queue
|
||||||
if (command === 'q' && !(playerQueue.includes(message.author))) {
|
if (command === 'q' && !(playerQueue.includes(message.author))) {
|
||||||
// Delete the message with the bot command
|
// Delete the message with the bot command
|
||||||
message.delete();
|
if (config.deletecommandstoggle) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
|
|
||||||
logger.log('info', `${message.author.username} joined the queue.`);
|
logger.log('info', `${message.author.username} joined the queue.`);
|
||||||
message.channel.send(`=====\n${message.author.username} joined the queue.`);
|
message.channel.send(`=====\n${message.author.username} joined the queue.`);
|
||||||
@@ -184,14 +186,18 @@ client.on('message', function (message) {
|
|||||||
}
|
}
|
||||||
else if (command === 'q' && (playerQueue.includes(message.author))) {
|
else if (command === 'q' && (playerQueue.includes(message.author))) {
|
||||||
// Delete the message with the bot command
|
// Delete the message with the bot command
|
||||||
message.delete();
|
if (config.deletecommandstoggle) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
message.channel.send(`${message.author.username} is too keen, you're already in the queue mate!`);
|
message.channel.send(`${message.author.username} is too keen, you're already in the queue mate!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Leave the queue
|
// Leave the queue
|
||||||
if(command === 'lq' && (playerQueue.includes(message.author))){
|
if(command === 'lq' && (playerQueue.includes(message.author))){
|
||||||
// Delete the message with the bot command
|
// Delete the message with the bot command
|
||||||
message.delete();
|
if (config.deletecommandstoggle) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
|
|
||||||
logger.log('info', `${message.author.username} left the queue.`);
|
logger.log('info', `${message.author.username} left the queue.`);
|
||||||
message.channel.send(`${message.author.username} left the queue.`);
|
message.channel.send(`${message.author.username} left the queue.`);
|
||||||
@@ -207,21 +213,27 @@ client.on('message', function (message) {
|
|||||||
}
|
}
|
||||||
else if (command === 'lq' && !(playerQueue.includes(message.author))) {
|
else if (command === 'lq' && !(playerQueue.includes(message.author))) {
|
||||||
// Delete the message with the bot command
|
// Delete the message with the bot command
|
||||||
message.delete();
|
if (config.deletecommandstoggle) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
message.channel.send(`${message.author.username} you can't leave the queue before you've joined it!`);
|
message.channel.send(`${message.author.username} you can't leave the queue before you've joined it!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the queue
|
// Show the queue
|
||||||
if(command === 'sq') {
|
if(command === 'sq') {
|
||||||
// Delete the message with the bot command
|
// Delete the message with the bot command
|
||||||
message.delete();
|
if (config.deletecommandstoggle) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
checkQueue(message);
|
checkQueue(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the queue
|
// Clear the queue
|
||||||
if(command === 'cq') {
|
if(command === 'cq') {
|
||||||
// Delete the message with the bot command
|
// Delete the message with the bot command
|
||||||
message.delete();
|
if (config.deletecommandstoggle) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
|
|
||||||
if (playerQueue.length === 0) {
|
if (playerQueue.length === 0) {
|
||||||
message.channel.send(`The queue is already empty...`);
|
message.channel.send(`The queue is already empty...`);
|
||||||
@@ -239,7 +251,9 @@ client.on('message', function (message) {
|
|||||||
const user = getUserFromMention(args[0]);
|
const user = getUserFromMention(args[0]);
|
||||||
|
|
||||||
// Delete the message with the bot command
|
// Delete the message with the bot command
|
||||||
message.delete();
|
if (config.deletecommandstoggle) {
|
||||||
|
message.delete();
|
||||||
|
}
|
||||||
|
|
||||||
if ((playerQueue.includes(user))) {
|
if ((playerQueue.includes(user))) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user