huge changes once again
diff --git a/src/events/channelCreate.ts b/src/events/channelCreate.ts
index ec788f7..3bde0f2 100644
--- a/src/events/channelCreate.ts
+++ b/src/events/channelCreate.ts
@@ -66,6 +66,6 @@
guild: channel.guild.id
}
}
- log(data, channel.client);
+ log(data);
} catch {}
}
diff --git a/src/events/channelDelete.ts b/src/events/channelDelete.ts
index e8c888a..2188141 100644
--- a/src/events/channelDelete.ts
+++ b/src/events/channelDelete.ts
@@ -68,6 +68,6 @@
guild: channel.guild.id
}
}
- log(data, channel.client);
+ log(data);
} catch {}
}
diff --git a/src/events/channelUpdate.ts b/src/events/channelUpdate.ts
index 25b7375..560ca11 100644
--- a/src/events/channelUpdate.ts
+++ b/src/events/channelUpdate.ts
@@ -130,6 +130,6 @@
guild: nc.guild.id
}
}
- log(data, client);
+ log(data);
} catch {}
}
\ No newline at end of file
diff --git a/src/events/commandError.ts b/src/events/commandError.ts
index ba47426..8edb480 100644
--- a/src/events/commandError.ts
+++ b/src/events/commandError.ts
@@ -1,17 +1,17 @@
-import generateEmojiEmbed from "../utils/generateEmojiEmbed.js";
+import EmojiEmbed from "../utils/generateEmojiEmbed.js";
export const event = 'commandError'
export async function callback(client, interaction, error) {
if (interaction.replied || interaction.deferred) {
- await interaction.followUp({embeds: [new generateEmojiEmbed()
+ await interaction.followUp({embeds: [new EmojiEmbed()
.setTitle("Something went wrong")
.setDescription(error.message ?? error.toString())
.setStatus("Danger")
.setEmoji("CONTROL.BLOCKCROSS")
], ephemeral: true})
} else {
- await interaction.reply({embeds: [new generateEmojiEmbed()
+ await interaction.reply({embeds: [new EmojiEmbed()
.setTitle("Something went wrong")
.setDescription(error.message ?? error.toString())
.setStatus("Danger")
diff --git a/src/events/emojiCreate.ts b/src/events/emojiCreate.ts
index c1ed3c5..1048869 100644
--- a/src/events/emojiCreate.ts
+++ b/src/events/emojiCreate.ts
@@ -25,6 +25,6 @@
guild: emoji.guild.id
}
}
- log(data, client);
+ log(data);
} catch {}
}
diff --git a/src/events/emojiDelete.ts b/src/events/emojiDelete.ts
index 59bed1e..02bec0d 100644
--- a/src/events/emojiDelete.ts
+++ b/src/events/emojiDelete.ts
@@ -26,6 +26,6 @@
guild: emoji.guild.id
}
}
- log(data, client);
+ log(data);
} catch {}
}
diff --git a/src/events/emojiUpdate.ts b/src/events/emojiUpdate.ts
index 2171b18..eb39cb9 100644
--- a/src/events/emojiUpdate.ts
+++ b/src/events/emojiUpdate.ts
@@ -32,6 +32,6 @@
guild: ne.guild.id
}
}
- log(data, client);
+ log(data);
} catch {}
}
\ No newline at end of file
diff --git a/src/events/guildBanAdd.ts b/src/events/guildBanAdd.ts
index 4209788..a1848fd 100644
--- a/src/events/guildBanAdd.ts
+++ b/src/events/guildBanAdd.ts
@@ -11,7 +11,7 @@
let auditLog = await getAuditLog(ban.guild, 'MEMBER_BAN_ADD')
let audit = auditLog.entries.filter(entry => entry.target.id == ban.user.id).first();
if (audit.executor.id == client.user.id) return
- console.log(ban.reason)
+ try { await client.database.history.create("ban", ban.guild.id, ban.user, audit.executor, audit.reason) } catch {}
let data = {
meta: {
type: 'memberBan',
@@ -34,6 +34,6 @@
guild: ban.guild.id
}
}
- log(data, ban.user.client);
+ log(data);
} catch {}
}
diff --git a/src/events/guildBanRemove.ts b/src/events/guildBanRemove.ts
index 11661f7..59fbf7a 100644
--- a/src/events/guildBanRemove.ts
+++ b/src/events/guildBanRemove.ts
@@ -12,6 +12,7 @@
let auditLog = await getAuditLog(ban.guild, 'MEMBER_BAN_REMOVE')
let audit = auditLog.entries.filter(entry => entry.target.id == ban.user.id).first();
if (audit.executor.id == client.user.id) return
+ try { await client.database.history.create("unban", ban.guild.id, ban.user, audit.executor, audit.reason) } catch {}
let data = {
meta: {
type: 'memberUnban',
@@ -32,6 +33,6 @@
guild: ban.guild.id
}
}
- log(data, ban.user.client);
+ log(data);
} catch (e) {console.log(e)}
}
diff --git a/src/events/guildCreate.ts b/src/events/guildCreate.ts
index 0222c7c..10986a5 100644
--- a/src/events/guildCreate.ts
+++ b/src/events/guildCreate.ts
@@ -1,5 +1,5 @@
import { MessageActionRow, MessageButton } from "discord.js";
-import generateEmojiEmbed from "../utils/generateEmojiEmbed.js";
+import EmojiEmbed from "../utils/generateEmojiEmbed.js";
import getEmojiByName from "../utils/getEmojiByName.js";
import guide from "../automations/guide.js";
diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index a1601bb..2175aaf 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -10,6 +10,9 @@
let auditLog = await getAuditLog(after.guild, 'MEMBER_UPDATE');
let audit = auditLog.entries.filter(entry => entry.target.id == after.id).first();
if (audit.executor.id == client.user.id) return;
+ try { await client.database.history.create(
+ "nickname", after.guild.id, after.user, audit.executor,
+ null, before.nickname || before.user.username, after.nickname || after.user.username) } catch {}
let data = {
meta: {
type: 'memberUpdate',
@@ -30,7 +33,7 @@
guild: after.guild.id
}
}
- log(data, after.client);
+ log(data);
}
} catch (e) { console.log(e) }
}
diff --git a/src/events/guildUpdate.ts b/src/events/guildUpdate.ts
index 400cfe4..ee02b66 100644
--- a/src/events/guildUpdate.ts
+++ b/src/events/guildUpdate.ts
@@ -53,6 +53,6 @@
guild: after.id
}
}
- log(data, after.client);
+ log(data);
} catch (e) {}
}
diff --git a/src/events/inviteCreate.ts b/src/events/inviteCreate.ts
index bdfeede..5081dd1 100644
--- a/src/events/inviteCreate.ts
+++ b/src/events/inviteCreate.ts
@@ -27,6 +27,6 @@
guild: invite.guild.id
}
}
- log(data, invite.client);
+ log(data);
} catch {}
}
diff --git a/src/events/inviteDelete.ts b/src/events/inviteDelete.ts
index dec234f..b6ddd22 100644
--- a/src/events/inviteDelete.ts
+++ b/src/events/inviteDelete.ts
@@ -27,6 +27,6 @@
guild: invite.guild.id
}
}
- log(data, invite.client);
+ log(data);
} catch {}
}
diff --git a/src/events/memberJoin.ts b/src/events/memberJoin.ts
index 317cc3a..f3c4d18 100644
--- a/src/events/memberJoin.ts
+++ b/src/events/memberJoin.ts
@@ -1,6 +1,8 @@
import { callback as statsChannelAdd } from '../automations/statsChannelAdd.js';
import { callback as welcome } from '../automations/welcome.js';
import log from '../utils/log.js';
+import client from '../utils/client.js';
+
export const event = 'guildMemberAdd'
export async function callback(_, member) {
@@ -8,6 +10,7 @@
try { statsChannelAdd(_, member); } catch {}
try {
const { log, NucleusColors, entry, renderUser, renderDelta } = member.client.logger
+ try { await client.database.history.create("join", member.guild.id, member.user, null, null) } catch {}
let data = {
meta: {
type: 'memberJoin',
@@ -28,6 +31,6 @@
guild: member.guild.id
}
}
- log(data, member.client);
+ log(data);
} catch {}
}
diff --git a/src/events/memberLeave.ts b/src/events/memberLeave.ts
index 22b7cd3..50901dc 100644
--- a/src/events/memberLeave.ts
+++ b/src/events/memberLeave.ts
@@ -19,6 +19,7 @@
}
let data
if (type == "kick") {
+ try { await client.database.history.create("kick", member.guild.id, member.user, audit.executor, audit.reason) } catch {}
data = {
meta: {
type: 'memberKick',
@@ -44,6 +45,7 @@
}
}
} else {
+ try { await client.database.history.create("leave", member.guild.id, member.user, null, null) } catch {}
data = {
meta: {
type: 'memberLeave',
@@ -67,6 +69,6 @@
}
}
}
- log(data, member.client);
+ log(data);
} catch {}
}
diff --git a/src/events/messageDelete.ts b/src/events/messageDelete.ts
index f0f5e00..229b126 100644
--- a/src/events/messageDelete.ts
+++ b/src/events/messageDelete.ts
@@ -40,6 +40,6 @@
guild: message.channel.guild.id
}
}
- log(data, client);
+ log(data);
} catch {}
}
diff --git a/src/events/messageEdit.ts b/src/events/messageEdit.ts
index ec713a2..0d42fb9 100644
--- a/src/events/messageEdit.ts
+++ b/src/events/messageEdit.ts
@@ -41,6 +41,6 @@
guild: newMessage.channel.guild.id
}
}
- log(data, client);
+ log(data);
} catch {}
}
diff --git a/src/events/roleCreate.ts b/src/events/roleCreate.ts
index 2664790..61d0a87 100644
--- a/src/events/roleCreate.ts
+++ b/src/events/roleCreate.ts
@@ -26,6 +26,6 @@
guild: role.guild.id
}
}
- log(data, client);
+ log(data);
} catch {}
}
diff --git a/src/events/roleDelete.ts b/src/events/roleDelete.ts
index 6edfeed..b0cb0f7 100644
--- a/src/events/roleDelete.ts
+++ b/src/events/roleDelete.ts
@@ -33,6 +33,6 @@
guild: role.guild.id
}
}
- log(data, client);
+ log(data);
} catch {}
}
diff --git a/src/events/roleUpdate.ts b/src/events/roleUpdate.ts
index faf3237..982d915 100644
--- a/src/events/roleUpdate.ts
+++ b/src/events/roleUpdate.ts
@@ -41,7 +41,7 @@
hidden: {
guild: nr.guild.id
}
- }
- log(data, client);
+ } // TODO: show perms changed
+ log(data);
} catch {}
}
\ No newline at end of file
diff --git a/src/events/threadCreate.ts b/src/events/threadCreate.ts
index 77e9dea..5c65d78 100644
--- a/src/events/threadCreate.ts
+++ b/src/events/threadCreate.ts
@@ -29,6 +29,6 @@
guild: thread.guild.id
}
}
- log(data, thread.client);
+ log(data);
} catch {}
}
diff --git a/src/events/threadDelete.ts b/src/events/threadDelete.ts
index 7bf8537..9507469 100644
--- a/src/events/threadDelete.ts
+++ b/src/events/threadDelete.ts
@@ -31,6 +31,6 @@
guild: thread.guild.id
}
}
- log(data, thread.client);
+ log(data);
} catch {}
}
diff --git a/src/events/threadUpdate.ts b/src/events/threadUpdate.ts
index 4067eba..f554a6c 100644
--- a/src/events/threadUpdate.ts
+++ b/src/events/threadUpdate.ts
@@ -38,6 +38,6 @@
guild: after.guild.id
}
}
- log(data, after.client);
+ log(data);
} catch {}
}