mirror of
https://github.com/danbulant/Shasha
synced 2026-07-09 21:11:14 +00:00
add: fixchat command
This commit is contained in:
parent
648ab8be67
commit
7ad96907a8
2 changed files with 65 additions and 40 deletions
24
cmds/utility/fixchat.js
Normal file
24
cmds/utility/fixchat.js
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const commando = require("@iceprod/discord.js-commando"),
|
||||||
|
{ fixChat } = require("../../resources/shaChat");
|
||||||
|
const { trySend } = require("../../resources/functions");
|
||||||
|
|
||||||
|
module.exports = class fixchat extends commando.Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: "fixchat",
|
||||||
|
memberName: "fixchat",
|
||||||
|
group: "utility",
|
||||||
|
description: "Fix broken chat."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async run(msg) {
|
||||||
|
const r;// = await fixChat();
|
||||||
|
if (r === 3) {
|
||||||
|
return trySend(this.client, msg, "Fixed!");
|
||||||
|
} else {
|
||||||
|
return trySend(this.client, msg, "Oopsie somethin's wrong...");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
const puppeteer = require('puppeteer');
|
const puppeteer = require('puppeteer');
|
||||||
const { trySend, ranLog, noPerm } = require('./functions');
|
const { trySend, noPerm } = require('./functions');
|
||||||
const Commando = require("@iceprod/discord.js-commando");
|
const Commando = require("@iceprod/discord.js-commando");
|
||||||
require("discord.js");
|
require("discord.js");
|
||||||
|
|
||||||
|
|
@ -70,11 +69,9 @@ async function fetchAnswer(page, index) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let chatIndex = 3;
|
let chatIndex = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
|
||||||
* @param {Commando.Client} client
|
* @param {Commando.Client} client
|
||||||
* @param {Commando.CommandoMessage} message
|
* @param {Commando.CommandoMessage} message
|
||||||
* @returns
|
* @returns
|
||||||
|
|
@ -99,7 +96,7 @@ let chatIndex = 3;
|
||||||
message.channel.stopTyping();
|
message.channel.stopTyping();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return ranLog(message, message.content.trim(), answer);
|
return //ranLog(message, message.content.trim(), answer);
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
noPerm(message);
|
noPerm(message);
|
||||||
message.channel.stopTyping();
|
message.channel.stopTyping();
|
||||||
|
|
@ -109,6 +106,10 @@ let chatIndex = 3;
|
||||||
message.channel.stopTyping();
|
message.channel.stopTyping();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { chatAnswer }
|
async function fixChat() {
|
||||||
|
return page1.then(r => r.reload()).then(() => {return chatIndex = 3}).catch(e => {return console.log(e)});
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { chatAnswer, fixChat }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue