More commands fixed and purge to here
diff --git a/src/reflex/statsChannelUpdate.ts b/src/reflex/statsChannelUpdate.ts
index d807267..2e12429 100644
--- a/src/reflex/statsChannelUpdate.ts
+++ b/src/reflex/statsChannelUpdate.ts
@@ -12,10 +12,9 @@
export async function callback(client: NucleusClient, member?: GuildMember, guild?: Guild, user?: User) {
if (!member && !guild) return;
guild = await client.guilds.fetch(member ? member.guild.id : guild!.id);
- if (!guild) return;
user = user ?? member!.user;
const config = await client.database.guilds.read(guild.id);
- Object.entries(config.getKey("stats")).forEach(async ([channel, props]) => {
+ Object.entries(config.stats).forEach(async ([channel, props]) => {
if ((props as PropSchema).enabled) {
let string = (props as PropSchema).name;
if (!string) return;
@@ -27,13 +26,13 @@
fetchedChannel = null;
}
if (!fetchedChannel) {
- const deleted = config.getKey("stats")[channel];
+ const deleted = config.stats[channel];
await client.database.guilds.write(guild!.id, null, `stats.${channel}`);
return singleNotify(
"statsChannelDeleted",
guild!.id,
"One or more of your stats channels have been deleted. Please use `/settings stats` if you wish to add the channel again.\n" +
- `The channels name was: ${deleted.name}`,
+ `The channels name was: ${deleted!.name}`,
"Critical"
);
}