Still got errors and warnings, mostly the same and easy to fix
diff --git a/src/reflex/statsChannelUpdate.ts b/src/reflex/statsChannelUpdate.ts
index b306ecc..7301a60 100644
--- a/src/reflex/statsChannelUpdate.ts
+++ b/src/reflex/statsChannelUpdate.ts
@@ -1,38 +1,38 @@
-import convertCurlyBracketString from '../utils/convertCurlyBracketString.js'
-import singleNotify from '../utils/singleNotify.js';
-import client from '../utils/client.js';
+import convertCurlyBracketString from "../utils/convertCurlyBracketString.js";
+import singleNotify from "../utils/singleNotify.js";
+import client from "../utils/client.js";
interface PropSchema { enabled: boolean, name: string }
export async function callback(_, member) {
- let guild = await client.guilds.fetch(member.guild.id)
- let config = await client.database.guilds.read(guild.id);
+ const guild = await client.guilds.fetch(member.guild.id);
+ const config = await client.database.guilds.read(guild.id);
Object.entries(config.getKey("stats")).forEach(async ([channel, props]) => {
if ((props as PropSchema).enabled) {
- let string = (props as PropSchema).name
- if (!string) return
- string = await convertCurlyBracketString(string, member.id, member.displayName, guild.name, guild.members)
+ let string = (props as PropSchema).name;
+ if (!string) return;
+ string = await convertCurlyBracketString(string, member.id, member.displayName, guild.name, guild.members);
let fetchedChannel;
try {
- fetchedChannel = await guild.channels.fetch(channel)
- } catch (e) { fetchedChannel = null }
+ fetchedChannel = await guild.channels.fetch(channel);
+ } catch (e) { fetchedChannel = null; }
if (!fetchedChannel) {
- let deleted = config.getKey("stats")[channel]
- console.log(`stats.${channel}`)
- console.log(guild.id)
- await client.database.guilds.write(guild.id, null, `stats.${channel}`)
+ const deleted = config.getKey("stats")[channel];
+ console.log(`stats.${channel}`);
+ console.log(guild.id);
+ 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}`,
"Critical"
- )
+ );
}
try {
- await fetchedChannel.setName(string.slice(0, 100))
+ await fetchedChannel.setName(string.slice(0, 100));
} catch (e) {
- console.error(e)
+ console.error(e);
}
}
});