forked from Supositware/Haha-Yes
replaced self-reload-json by auto-reload
This commit is contained in:
parent
c229227ef2
commit
c17c35ab8d
4 changed files with 9 additions and 9 deletions
|
@ -44,7 +44,7 @@ class TtsCommand extends Command {
|
|||
}
|
||||
|
||||
// Write the binary audio content to a local file
|
||||
await fs.writeFile('tts.mp3', response.audioContent, 'binary', err => {
|
||||
fs.writeFile('tts.mp3', response.audioContent, 'binary', err => {
|
||||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
message.channel.send('An error has occured, the message is probably too long');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const Discord = require('discord.js');
|
||||
const SelfReloadJSON = require('self-reload-json');
|
||||
const reload = require('auto-reload');
|
||||
const fs = require('fs');
|
||||
|
||||
class taglistCommand extends Command {
|
||||
|
@ -19,7 +19,7 @@ class taglistCommand extends Command {
|
|||
|
||||
async exec(message) {
|
||||
try {
|
||||
let customresponse = new SelfReloadJSON(`./tag/${message.guild.id}.json`);
|
||||
let customresponse = reload(`../../tag/${message.guild.id}.json`);
|
||||
let count = Object.keys(customresponse).length
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +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');
|
||||
const reload = require('auto-reload');
|
||||
|
||||
class MessageListener extends Listener {
|
||||
constructor() {
|
||||
|
@ -13,7 +13,7 @@ class MessageListener extends Listener {
|
|||
}
|
||||
|
||||
async exec(message) {
|
||||
let autoresponse = new SelfReloadJSON('./json/autoresponse.json');
|
||||
let autoresponse = reload('../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")
|
||||
}
|
||||
}
|
||||
let customresponse = new SelfReloadJSON(`./tag/${message.guild.id}.json`);
|
||||
let customresponse = reload(`./tag/${message.guild.id}.json`);
|
||||
// User autoresponse
|
||||
if(customresponse[message_content]) {
|
||||
message.channel.send(customresponse[message_content])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { Listener } = require('discord-akairo');
|
||||
const Discord = require('discord.js');
|
||||
const SelfReloadJSON = require('self-reload-json');
|
||||
const reload = require('auto-reload');
|
||||
|
||||
class MessageReactionAddListener extends Listener {
|
||||
constructor() {
|
||||
|
@ -15,7 +15,7 @@ class MessageReactionAddListener extends Listener {
|
|||
let messageAttachments = reaction.message.attachments.map(u=> `${u.url}`);
|
||||
|
||||
if (reaction.emoji.name === '🌟' && reaction.count === 4) {
|
||||
let starboardChannel = new SelfReloadJSON(`./starboard/${reaction.message.guild.id}.json`);
|
||||
let starboardChannel = reload(`../starboard/${reaction.message.guild.id}.json`);
|
||||
const channel = this.client.channels.get(starboardChannel['starboard']);
|
||||
|
||||
const starEmbed = new Discord.RichEmbed()
|
||||
|
@ -28,7 +28,7 @@ class MessageReactionAddListener extends Listener {
|
|||
return channel.send(`From: ${reaction.message.channel}\n${messageAttachments}`);
|
||||
}
|
||||
if (reaction.emoji.name === '✡' && reaction.count === 4) {
|
||||
let shameboardChannel = new SelfReloadJSON(`./starboard/${message.guild.id}.json`);
|
||||
let shameboardChannel = reload(`../starboard/${message.guild.id}.json`);
|
||||
const channel = client.channels.get(shameboardChannel['shameboard']);
|
||||
|
||||
const starEmbed = new Discord.RichEmbed()
|
||||
|
|
Loading…
Reference in a new issue