diff --git a/commands/admin/prune.js b/commands/admin/prune.js index dec1025..7ffe7a7 100644 --- a/commands/admin/prune.js +++ b/commands/admin/prune.js @@ -3,7 +3,7 @@ const { Command } = require('discord-akairo'); class PruneCommand extends Command { constructor() { super('Prune', { - aliases: ['Prune'], + aliases: ['Prune', 'clean', 'purge'], category: 'admin', args: [ { @@ -23,7 +23,7 @@ class PruneCommand extends Command { } async exec(message,args) { - if (args.amount > 99) return; + if (args.amount >= 100) return; message.channel.bulkDelete(args.amount + 1, true); } } diff --git a/commands/admin/untag.js b/commands/admin/untag.js index dfcf9fa..d2be14d 100644 --- a/commands/admin/untag.js +++ b/commands/admin/untag.js @@ -44,7 +44,7 @@ class UnTagCommand extends Command { } })}}); - return message.say(`The following autoresponse have been deleted: ${trigger}`); + return message.channel.send(`The following autoresponse have been deleted: ${trigger}`); } } diff --git a/commands/general/ttsvc.js b/commands/general/ttsvc.js index e36247a..84b8581 100644 --- a/commands/general/ttsvc.js +++ b/commands/general/ttsvc.js @@ -43,7 +43,7 @@ class TtsvcCommand extends Command { fs.writeFile('ttsvc.mp3', response.audioContent, 'binary', err => { if (err) { console.error('ERROR:', err); - message.say('An error has occured, the message is probably too long') + message.channel.send('An error has occured, the message is probably too long') return; } console.log('Audio content written to file: ttsvc.mp3'); @@ -57,7 +57,7 @@ class TtsvcCommand extends Command { // If user say "stop" make the bot leave voice channel if (text == 'stop') { voiceChannel.leave(); - message.say('I leaved the channel'); + message.channel.send('I leaved the channel'); } else voiceChannel.join().then(connection => { const dispatcher = connection.playStream('./ttsvc.mp3'); diff --git a/commands/utility/taglist.js b/commands/utility/taglist.js index 03059e3..89c55c1 100644 --- a/commands/utility/taglist.js +++ b/commands/utility/taglist.js @@ -1,4 +1,7 @@ const { Command } = require('discord-akairo'); +const Discord = require('discord.js'); +const SelfReloadJSON = require('self-reload-json'); +const fs = require('fs'); class taglistCommand extends Command { constructor() { diff --git a/listeners/message.js b/listeners/message.js index c58a0de..0f66026 100644 --- a/listeners/message.js +++ b/listeners/message.js @@ -2,6 +2,7 @@ const { Listener } = require('discord-akairo'); const responseObject = require("../json/reply.json"); const reactObject = require("../json/react.json"); const imgResponseObject = require("../json/imgreply.json"); +const SelfReloadJSON = require('self-reload-json'); class MessageListener extends Listener { constructor() { @@ -12,8 +13,7 @@ class MessageListener extends Listener { } async exec(message) { - const autoresponse = require("../json/autoresponse.json"); - + let autoresponse = new SelfReloadJSON('./json/autoresponse.json'); let message_content = message.content.toLowerCase(); if (message.author.bot) return; { @@ -39,7 +39,7 @@ class MessageListener extends Listener { message.react("496028845967802378") } } - const customresponse = require(`../tag/${message.guild.id}.json`); + let customresponse = new SelfReloadJSON(`./tag/${message.guild.id}.json`); // User autoresponse if(customresponse[message_content]) { message.channel.send(customresponse[message_content])