loads of new commands, updates and bug fixes
diff --git a/src/utils/singleNotify.ts b/src/utils/singleNotify.ts
index 4e9e6fe..a983478 100644
--- a/src/utils/singleNotify.ts
+++ b/src/utils/singleNotify.ts
@@ -1,4 +1,4 @@
-import readConfig from "./readConfig.js";
+import client from './client.js';
import generateEmojiEmbed from "./generateEmojiEmbed.js";
let severities = {
@@ -7,17 +7,18 @@
"Info": "Success"
}
-export default async function(client, type: string, guild: string, message: string, severity: string) {
- let config = await readConfig(guild);
- if (config.singleEventNotifications[type]) return;
- // TODO: Set config.singleEventNotifications[type] to true
- let channel = await client.channels.fetch(config.logging.staff);
- if (!channel) return;
+export default async function(type: string, guild: string, message: string, severity: string) {
+ let data = await client.database.read(guild);
+ if (data.singleEventNotifications[type]) return;
+ data.singleEventNotifications[type] = true;
+ client.database.write(guild, data);
try {
+ let channel = await client.channels.fetch(data.logging.staff.channel);
+ if (!channel) return;
await channel.send({embeds: [new generateEmojiEmbed()
.setTitle(`${severity} notification`)
.setDescription(message)
- .setColor(severities[severity])
+ .setStatus(severities[severity])
.setEmoji("CONTROL.BLOCKCROSS")
]})
} catch (err) {