channel logs

master
Kit Kasune 4 years ago
parent 15260ee952
commit b8f0516425
  1. 5
      commands/moderation/logs.js
  2. 14
      events/channelCreate.js
  3. 14
      events/channelDelete.js

@ -7,9 +7,8 @@ const LogData = require('../../models/log');
const ObjLogTypes = { const ObjLogTypes = {
mdelete: ['md', 'mdelete', 'messagedelete', 'deletemessage', 'deletemsg', 'msgdelete'], mdelete: ['md', 'mdelete', 'messagedelete', 'deletemessage', 'deletemsg', 'msgdelete'],
medit: ['me', 'medit', 'messageedit', 'editmessage', 'msgedit', 'editmsg'], medit: ['me', 'medit', 'messageedit', 'editmessage', 'msgedit', 'editmsg'],
chnew: ['chn', 'chc', 'newch', 'newchannel', 'chcreate', 'channelcreate'], ch: ['channel', 'ch'],
//chedit: ['channeledit'], //chedit: ['channeledit'],
chdelete: ['chd', 'channeldelete', 'deletechannel', 'deletech', 'chdelete'],
vc: ['voice', 'vc'], vc: ['voice', 'vc'],
//servervcmute: [], //servervcmute: [],
//servervcdeafen: [], //servervcdeafen: [],
@ -70,7 +69,7 @@ module.exports = {
} }
if (['l', 'list'].includes(args[0].toLowerCase())) { if (['l', 'list'].includes(args[0].toLowerCase())) {
return message.channel.send("Valid log types:\n\n-`msgdelete` - Shows the content of a message that was deleted, in any channel.\n-`msgedit` - Shows both the old and new versions of a message when it is edited.\n-`vc` - Logs when members join and leave VCs."); return message.channel.send("Valid log types:\n\n-`msgdelete` - Shows the content of a message that was deleted, in any channel.\n-`msgedit` - Shows both the old and new versions of a message when it is edited.\n-`vc` - Logs when members join and leave VCs.\n-`ch` - Logs channel creations and deletions.");
} }
if (['v', 'view'].includes(args[0].toLowerCase())) { if (['v', 'view'].includes(args[0].toLowerCase())) {

@ -0,0 +1,14 @@
const Discord = require('discord.js');
module.exports = (client, channel) => {
let ts = client.guildconfig.logs.has(channel.guild.id) && client.guildconfig.logs.get(channel.guild.id).has('ch') ? client.guildconfig.logs.get(channel.guild.id).get('ch') : null;
if (ts) {if (channel.guild.channels.cache.has(ts) && channel.guild.channels.cache.get(ts).permissionsFor(client.user.id).has("SEND_MESSAGES")) {
channel.guild.channels.cache.get(ts).send(new Discord.MessageEmbed()
.setTitle("New Channel")
.setDescription(`<#${channel.id}> || **#${channel.name}**${channel.parent && channel.parent.name ? `\nCategory: **${channel.parent.name}**` : ''}`)
.setColor('936b30')
.setFooter("Natsuki", client.user.avatarURL())
.setTimestamp()
);
}}
};

@ -0,0 +1,14 @@
const Discord = require('discord.js');
module.exports = (client, channel) => {
let ts = client.guildconfig.logs.has(channel.guild.id) && client.guildconfig.logs.get(channel.guild.id).has('ch') ? client.guildconfig.logs.get(channel.guild.id).get('ch') : null;
if (ts) {if (channel.guild.channels.cache.has(ts) && channel.guild.channels.cache.get(ts).permissionsFor(client.user.id).has("SEND_MESSAGES")) {
channel.guild.channels.cache.get(ts).send(new Discord.MessageEmbed()
.setTitle("Channel Deleted")
.setDescription(`Name: **#${channel.name}**${channel.parent && channel.parent.name ? `\nCategory: **${channel.parent.name}**` : ''}`)
.setColor('936b30')
.setFooter("Natsuki", client.user.avatarURL())
.setTimestamp()
);
}}
};
Loading…
Cancel
Save