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) {
|
||||
const logStats = await LogStats.findOne({where: {guild: newChannel.guild.id}});
|
||||
|
||||
if (oldChannel === newChannel) return;
|
||||
if (logStats) {
|
||||
const fetchedLogs = await newChannel.guild.fetchAuditLogs({
|
||||
limit: 1,
|
||||
|
|
|
@ -12,8 +12,9 @@ class roleUpdateListener extends Listener {
|
|||
});
|
||||
}
|
||||
|
||||
async exec(role) {
|
||||
const guild = role.guild;
|
||||
async exec(oldRole, newRole) {
|
||||
if (oldRole === newRole) return;
|
||||
const guild = oldRole.guild;
|
||||
const logStats = await LogStats.findOne({where: {guild: guild.id}});
|
||||
if (logStats) {
|
||||
const fetchedLogs = await guild.fetchAuditLogs({
|
||||
|
@ -27,12 +28,12 @@ class roleUpdateListener extends Listener {
|
|||
let Embed = this.client.util.embed()
|
||||
.setColor('NAVY')
|
||||
.setTitle('Role updated')
|
||||
.setDescription(`${role.name} got updated!`)
|
||||
.setDescription(`${oldRole.name} got updated!`)
|
||||
.setTimestamp();
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue