Merge branch 'main' into main

This commit is contained in:
Daniel Bulant 2021-08-27 13:28:54 +02:00 committed by GitHub
commit d4db3c7330
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View file

@ -1,8 +1,7 @@
'use strict'; 'use strict';
const commando = require("@iceprod/discord.js-commando"); const commando = require("@iceprod/discord.js-commando");
const { trySend } = require("../../resources/functions"); // const { chatAnswer } = require("../../resources/shaChat");
const { chatAnswer } = require("../../resources/shaChat");
module.exports = class chat extends commando.Command { module.exports = class chat extends commando.Command {
constructor(client) { constructor(client) {
@ -13,12 +12,8 @@ module.exports = class chat extends commando.Command {
description: "Lets chat!" description: "Lets chat!"
}); });
} }
async run(msg, args) { async run(msg) {
if (!args) { return "Chat is currently unavailable.";
return trySend(msg.client, msg, "Ask me somethin?"); // chatAnswer(this.client, msg);
}
msg.channel.startTyping();
return trySend(this.client, msg, await chatAnswer(
msg.cleanContent.slice((msg.guild.commandPrefix + msg.alias).length + 1).trim()));
} }
}; };

View file

@ -15,4 +15,7 @@ dbClient.connect(e => {
const database = dbClient.db("Shasha"); const database = dbClient.db("Shasha");
module.exports = { dbClient, database } /**
* @type {dbClient: MongoClient, database: Db}
*/
module.exports = { dbClient, database }