Warnings for pinging dnd/afk members

master
Kit Kasune 4 years ago
parent e92ef55395
commit c3b3c0840e
  1. 2
      commands/dnd.js
  2. 2
      events/message.js
  3. 7
      util/mention.js

@ -24,6 +24,6 @@ module.exports = {
tu.statustype = 'dnd';
tu.statusmsg = reason.trim();
tu.save();
return message.reply(`I set your Do not Disturb message to: ${reason.trim()}`);
return message.reply(`I set your ${tu.statusclearmode === 'auto' ? 'automatically' : 'manually'}-clearing Do not Disturb message to: ${reason.trim()}`);
}
};

@ -22,6 +22,8 @@ module.exports = async (client, message) => {
: message.content.slice(3 + client.user.id.length).trim().split(/\s+/g);
var cmd = args.shift().toLowerCase().trim();
if (mention && message.guild) {require('../util/mention')(message, msg, args, cmd, prefix, mention, client);}
try {
if (msg.startsWith(prefix) || msg.startsWith(`<@${client.user.id}>`) || msg.startsWith(`<@!${client.user.id}>`)) {
let command = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd));

@ -0,0 +1,7 @@
const mongooes= require('mongoose');
const UserData = require('../models/user');
module.exports = async(message, msg, args, cmd, prefix, mention, client) => {
let tu = await UserData.findOne({uid: mention.id});
if (tu) {if (tu.statusmsg.length) {return message.reply(`That user ${tu.statustype === 'dnd' ? 'wishes not to be disturbed' : 'is AFK'}. Reason: ${tu.statusmsg}`);}}
};
Loading…
Cancel
Save