You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Natsuki/util/response/getresponse.js

9 lines
446 B

const Responses = require('../../models/responses');
module.exports = async (message, name) => {
let tr = await Responses.findOne({gid: message.guild.id});
if (!tr) {message.reply("This server does not have any responses saved!"); return null;}
if (!tr.responses.has(name.toLowerCase())) {message.reply("I don't have that response saved here."); return null;}
message.delete();
return tr.responses.get(name.toLowerCase());
};