generated from nhcarrigan/template
@@ -15,6 +15,7 @@ import {
|
||||
type Message,
|
||||
} from "discord.js";
|
||||
import { checkGuildEntitlement } from "../utils/checkEntitlement.js";
|
||||
import { logger } from "../utils/logger.js";
|
||||
import type { Liora } from "../interfaces/liora.js";
|
||||
|
||||
/**
|
||||
@@ -41,6 +42,10 @@ const messageCreate = async(
|
||||
return;
|
||||
}
|
||||
|
||||
await logger.metric("highlight_triggered", highlights.length, {
|
||||
guildId: message.guild.id,
|
||||
});
|
||||
|
||||
await Promise.all(
|
||||
// eslint-disable-next-line max-lines-per-function -- It's mostly components.
|
||||
highlights.map(async(record) => {
|
||||
|
||||
+5
-1
@@ -4,6 +4,7 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { DiscordAnalytics } from "@nhcarrigan/discord-analytics";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import {
|
||||
Client,
|
||||
@@ -25,17 +26,20 @@ const liora: Liora = {
|
||||
GatewayIntentBits.MessageContent,
|
||||
],
|
||||
}),
|
||||
|
||||
};
|
||||
|
||||
const analytics = new DiscordAnalytics(liora.discord, logger);
|
||||
|
||||
liora.discord.once(Events.ClientReady, () => {
|
||||
void logger.log(
|
||||
"debug",
|
||||
`Logged in as ${liora.discord.user?.username ?? "unknown"}`,
|
||||
);
|
||||
analytics.startCron();
|
||||
});
|
||||
|
||||
liora.discord.on(Events.InteractionCreate, (interaction) => {
|
||||
void analytics.logGatewayEvent(Events.InteractionCreate, { ...interaction });
|
||||
if (interaction.isChatInputCommand()) {
|
||||
if (!interaction.inCachedGuild()) {
|
||||
void interaction.reply({
|
||||
|
||||
Reference in New Issue
Block a user