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.
|
|
|
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;}
|
|
|
|
if (message.guild.me.permissions.has("DELETE_MESSAGES")) {message.delete();}
|
|
|
|
return tr.responses.get(name.toLowerCase());
|
|
|
|
};
|