mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-31 01:11:32 +00:00
add ban message to bot-log channel
This commit is contained in:
parent
e823a98321
commit
be3022f7ee
1 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,8 @@ const authors = [];
|
|||
let warned = [];
|
||||
let banned = [];
|
||||
let messagelog = [];
|
||||
let config = require('config');
|
||||
let botlog = config.get('moderation').logchannel;
|
||||
let hasPerms = require('../helpers.js').hasPerms;
|
||||
let inPrivate = require('../helpers.js').inPrivate;
|
||||
let hasExcludedSpamChannels = require('../helpers.js').hasExcludedSpamChannels;
|
||||
|
@ -29,7 +31,7 @@ exports.antiSpam = function(bot) {
|
|||
|
||||
|
||||
bot.on('message', msg => {
|
||||
if(!inPrivate(msg) && hasPerms(msg) || msg.author.bot || hasExcludedSpamChannels(msg) || hasExcludedSpamUsers(msg)) {
|
||||
if(inPrivate(msg) || hasPerms(msg) || msg.author.bot || hasExcludedSpamChannels(msg) || hasExcludedSpamUsers(msg)) {
|
||||
return
|
||||
}
|
||||
if(msg.author.id != bot.user.id){
|
||||
|
@ -114,6 +116,7 @@ exports.antiSpam = function(bot) {
|
|||
if (user) {
|
||||
user.ban().then((member) => {
|
||||
msg.channel.send(msg.author + " " +banMessage);
|
||||
bot.channels.get(botlog).send(msg.author + " " +banMessage);
|
||||
return true;
|
||||
}).catch(() => {
|
||||
msg.channel.send("insufficient permission to kick " + msg.author + " for spamming.");
|
||||
|
|
Loading…
Add table
Reference in a new issue