generated from nhcarrigan/template
@@ -4,6 +4,7 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { DiscordAnalytics } from "@nhcarrigan/discord-analytics";
|
||||
import { Client,
|
||||
GatewayIntentBits,
|
||||
Events,
|
||||
@@ -59,10 +60,13 @@ const amari: Amari = {
|
||||
recentlyActiveChannels: new Set<string>(),
|
||||
};
|
||||
|
||||
const analytics = new DiscordAnalytics(amari.discord, logger);
|
||||
|
||||
amari.discord.once(Events.ClientReady, () => {
|
||||
void logger.log("debug",
|
||||
`Authenticated to Discord as ${amari.discord.user?.username ?? "unknown"}`);
|
||||
void cacheData(amari);
|
||||
analytics.startCron();
|
||||
scheduleJob("post news", "0 * * * *", async() => {
|
||||
await postFreeCodeCampNews(amari);
|
||||
await postHackerNews(amari);
|
||||
@@ -91,6 +95,7 @@ amari.discord.on(Events.MessageCreate, (message) => {
|
||||
});
|
||||
|
||||
amari.discord.on(Events.InteractionCreate, (interaction) => {
|
||||
void analytics.logGatewayEvent(Events.InteractionCreate, { ...interaction });
|
||||
if (interaction.isButton() && interaction.customId === "resolve") {
|
||||
if (interaction.user.id !== ids.users.naomi) {
|
||||
return void interaction.reply(
|
||||
|
||||
Reference in New Issue
Block a user