Still got errors and warnings, mostly the same and easy to fix
diff --git a/src/events/channelCreate.ts b/src/events/channelCreate.ts
index fa66755..c4c1347 100644
--- a/src/events/channelCreate.ts
+++ b/src/events/channelCreate.ts
@@ -1,71 +1,70 @@
-export const event = 'channelCreate'
+export const event = "channelCreate";
export async function callback(client, channel) {
- try {
- const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = channel.client.logger
- let auditLog = await getAuditLog(channel.guild, 'CHANNEL_CREATE');
- let audit = auditLog.entries.filter(entry => entry.target.id === channel.id).first();
- if (audit.executor.id === client.user.id) return;
- let emoji;
- let readableType;
- let displayName;
- switch (channel.type) {
- case 'GUILD_TEXT': {
- emoji = "CHANNEL.TEXT.CREATE";
- readableType = "Text";
- displayName = "Text Channel"
- break;
- }
- case 'GUILD_NEWS': {
- emoji = "CHANNEL.TEXT.CREATE";
- readableType = "Announcement";
- displayName = "Announcement Channel"
- break;
- }
- case 'GUILD_VOICE': {
- emoji = "CHANNEL.VOICE.CREATE";
- readableType = "Voice";
- displayName = "Voice Channel"
- break;
- }
- case 'GUILD_STAGE': {
- emoji = "CHANNEL.VOICE.CREATE";
- readableType = "Stage";
- displayName = "Stage Channel"
- }
- case 'GUILD_CATEGORY': {
- emoji = "CHANNEL.CATEGORY.CREATE";
- readableType = "Category";
- displayName = "Category"
- break;
- }
- default: {
- emoji = "CHANNEL.TEXT.CREATE";
- readableType = "Channel";
- displayName = "Channel"
- }
+ const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = channel.client.logger;
+ const auditLog = await getAuditLog(channel.guild, "CHANNEL_CREATE");
+ const audit = auditLog.entries.filter(entry => entry.target.id === channel.id).first();
+ if (audit.executor.id === client.user.id) return;
+ let emoji;
+ let readableType;
+ let displayName;
+ switch (channel.type) {
+ case "GUILD_TEXT": {
+ emoji = "CHANNEL.TEXT.CREATE";
+ readableType = "Text";
+ displayName = "Text Channel";
+ break;
+ }
+ case "GUILD_NEWS": {
+ emoji = "CHANNEL.TEXT.CREATE";
+ readableType = "Announcement";
+ displayName = "Announcement Channel";
+ break;
+ }
+ case "GUILD_VOICE": {
+ emoji = "CHANNEL.VOICE.CREATE";
+ readableType = "Voice";
+ displayName = "Voice Channel";
+ break;
+ }
+ case "GUILD_STAGE": {
+ emoji = "CHANNEL.VOICE.CREATE";
+ readableType = "Stage";
+ displayName = "Stage Channel";
+ break;
+ }
+ case "GUILD_CATEGORY": {
+ emoji = "CHANNEL.CATEGORY.CREATE";
+ readableType = "Category";
+ displayName = "Category";
+ break;
+ }
+ default: {
+ emoji = "CHANNEL.TEXT.CREATE";
+ readableType = "Channel";
+ displayName = "Channel";
+ }
+ }
+ const data = {
+ meta: {
+ type: "channelCreate",
+ displayName: displayName + " Created",
+ calculateType: "channelUpdate",
+ color: NucleusColors.green,
+ emoji: emoji,
+ timestamp: channel.createdTimestamp
+ },
+ list: {
+ channelId: entry(channel.id, `\`${channel.id}\``),
+ name: entry(channel.name, renderChannel(channel)),
+ type: entry(channel.type, readableType),
+ category: entry(channel.parent ? channel.parent.id : null, channel.parent ? channel.parent.name : "Uncategorised"),
+ createdBy: entry(audit.executor.id, renderUser(audit.executor)),
+ created: entry(channel.createdTimestamp, renderDelta(channel.createdTimestamp))
+ },
+ hidden: {
+ guild: channel.guild.id
}
- let data = {
- meta: {
- type: 'channelCreate',
- displayName: displayName + ' Created',
- calculateType: 'channelUpdate',
- color: NucleusColors.green,
- emoji: emoji,
- timestamp: channel.createdTimestamp
- },
- list: {
- channelId: entry(channel.id, `\`${channel.id}\``),
- name: entry(channel.name, renderChannel(channel)),
- type: entry(channel.type, readableType),
- category: entry(channel.parent ? channel.parent.id : null, channel.parent ? channel.parent.name : "Uncategorised"),
- createdBy: entry(audit.executor.id, renderUser(audit.executor)),
- created: entry(channel.createdTimestamp, renderDelta(channel.createdTimestamp))
- },
- hidden: {
- guild: channel.guild.id
- }
- }
- log(data);
- } catch {}
+ };
+ log(data);
}