mirror of
https://github.com/danbulant/Shasha
synced 2026-06-07 16:43:02 +00:00
chat and errLoop
This commit is contained in:
parent
05dce309d1
commit
3493bc88a9
2 changed files with 7 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ async function errLog(theError, msg, client, sendTheError, errorMessage, notify)
|
||||||
if (!(theError instanceof Error) || !client) return console.error("[ERRLOG] Not error instance or no required param:", theError);
|
if (!(theError instanceof Error) || !client) return console.error("[ERRLOG] Not error instance or no required param:", theError);
|
||||||
let [ret, logThis, inLogChannel, sendErr] = [undefined, '', '', ''];
|
let [ret, logThis, inLogChannel, sendErr] = [undefined, '', '', ''];
|
||||||
if (msg instanceof Message) {
|
if (msg instanceof Message) {
|
||||||
client.emit("commandError", msg.command, theError, msg);
|
// client.emit("commandError", msg.command, theError, msg);
|
||||||
logThis = `\`${msg.command?.name}\` (${msg.id}) ${msg.url} in ${msg.guild ? `**${msg.channel.name}** (${msg.channel.id}) of **${msg.guild.name}** (${msg.guild.id})` : `**DM**`} ran by **${msg.author.tag}** (${msg.author.id}) \n\n`;
|
logThis = `\`${msg.command?.name}\` (${msg.id}) ${msg.url} in ${msg.guild ? `**${msg.channel.name}** (${msg.channel.id}) of **${msg.guild.name}** (${msg.guild.id})` : `**DM**`} ran by **${msg.author.tag}** (${msg.author.id}) \n\n`;
|
||||||
if (errorMessage) {
|
if (errorMessage) {
|
||||||
if (errorMessage.length > 0) {
|
if (errorMessage.length > 0) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,12 @@ const URL = [
|
||||||
*/
|
*/
|
||||||
|
|
||||||
async function chatAnswer(message) {
|
async function chatAnswer(message) {
|
||||||
return axios.post("https://rebot.me/ask", { username: "simsimi", question: message }).then(r => r.data).catch(() => { });
|
// return axios.post("https://rebot.me/ask", { username: "simsimi", question: message }).then(r => r.data).catch(() => { });
|
||||||
|
console.log(message);
|
||||||
|
return axios.get(`https://api.simsimi.net/v1/?text=${message.replace(/( |\n|\t)+/, "+")}&lang=en&key=API-TEST-WEB`).then(r => {
|
||||||
|
console.log(r.data);
|
||||||
|
return r.data.success;
|
||||||
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { chatAnswer }
|
module.exports = { chatAnswer }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue