forked from Supositware/Haha-Yes
Don't spam the logs
Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
parent
c6d10ac10b
commit
f405116827
2 changed files with 6 additions and 5 deletions
|
@ -11,7 +11,7 @@ class channelUpdateListener extends Listener {
|
||||||
|
|
||||||
async exec(oldChannel, newChannel) {
|
async exec(oldChannel, newChannel) {
|
||||||
const logStats = await LogStats.findOne({where: {guild: newChannel.guild.id}});
|
const logStats = await LogStats.findOne({where: {guild: newChannel.guild.id}});
|
||||||
|
if (oldChannel === newChannel) return;
|
||||||
if (logStats) {
|
if (logStats) {
|
||||||
const fetchedLogs = await newChannel.guild.fetchAuditLogs({
|
const fetchedLogs = await newChannel.guild.fetchAuditLogs({
|
||||||
limit: 1,
|
limit: 1,
|
||||||
|
|
|
@ -12,8 +12,9 @@ class roleUpdateListener extends Listener {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async exec(role) {
|
async exec(oldRole, newRole) {
|
||||||
const guild = role.guild;
|
if (oldRole === newRole) return;
|
||||||
|
const guild = oldRole.guild;
|
||||||
const logStats = await LogStats.findOne({where: {guild: guild.id}});
|
const logStats = await LogStats.findOne({where: {guild: guild.id}});
|
||||||
if (logStats) {
|
if (logStats) {
|
||||||
const fetchedLogs = await guild.fetchAuditLogs({
|
const fetchedLogs = await guild.fetchAuditLogs({
|
||||||
|
@ -27,12 +28,12 @@ class roleUpdateListener extends Listener {
|
||||||
let Embed = this.client.util.embed()
|
let Embed = this.client.util.embed()
|
||||||
.setColor('NAVY')
|
.setColor('NAVY')
|
||||||
.setTitle('Role updated')
|
.setTitle('Role updated')
|
||||||
.setDescription(`${role.name} got updated!`)
|
.setDescription(`${oldRole.name} got updated!`)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
if (!creationLog) return channel.send(Embed);
|
if (!creationLog) return channel.send(Embed);
|
||||||
|
|
||||||
Embed.setDescription(`${role.name} got updated by ${creationLog.executor}`);
|
Embed.setDescription(`${oldRole.name} got updated by ${creationLog.executor}`);
|
||||||
|
|
||||||
channel.send(Embed);
|
channel.send(Embed);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue