generated from nhcarrigan/template
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { DiscordAnalytics } from "@nhcarrigan/discord-analytics";
|
||||
import { Client, GatewayIntentBits, Events, MessageFlags } from "discord.js";
|
||||
import { blocks } from "./config/blocks.js";
|
||||
import { checkAltText } from "./modules/checkAltText.js";
|
||||
@@ -18,18 +19,23 @@ const client = new Client({
|
||||
],
|
||||
});
|
||||
|
||||
const analytics = new DiscordAnalytics(client, logger);
|
||||
|
||||
client.once(Events.ClientReady, () => {
|
||||
void logger.log(
|
||||
"info",
|
||||
`Logged in as ${client.user?.username ?? "unknown user"}`,
|
||||
);
|
||||
analytics.startCron();
|
||||
});
|
||||
|
||||
client.on(Events.MessageCreate, (message) => {
|
||||
void analytics.logGatewayEvent(Events.MessageCreate, { ...message });
|
||||
void checkAltText(message);
|
||||
});
|
||||
|
||||
client.on(Events.InteractionCreate, (interaction) => {
|
||||
void analytics.logGatewayEvent(Events.InteractionCreate, { ...interaction });
|
||||
if (!interaction.isChatInputCommand()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user