mirror of
https://github.com/pacnpal/markov-discord.git
synced 2025-12-22 03:41:05 -05:00
Update dependencies to latest
This commit is contained in:
16
src/index.ts
16
src/index.ts
@@ -12,13 +12,11 @@ import Markov, {
|
||||
import { createConnection } from 'typeorm';
|
||||
import { MarkovInputData } from 'markov-strings-db/dist/src/entity/MarkovInputData';
|
||||
import type { PackageJsonPerson } from 'types-package-json';
|
||||
import {
|
||||
APISelectMenuComponent,
|
||||
APIInteractionGuildMember,
|
||||
} from 'discord.js/node_modules/discord-api-types';
|
||||
|
||||
import makeEta from 'simple-eta';
|
||||
import formatDistanceToNow from 'date-fns/formatDistanceToNow';
|
||||
import addSeconds from 'date-fns/addSeconds';
|
||||
import type { APIInteractionGuildMember, APISelectMenuComponent } from 'discord-api-types';
|
||||
import L from './logger';
|
||||
import { Channel } from './entity/Channel';
|
||||
import { Guild } from './entity/Guild';
|
||||
@@ -632,6 +630,11 @@ client.on('interactionCreate', async (interaction) => {
|
||||
await interaction.followUp({ content: INVALID_PERMISSIONS_MESSAGE, ephemeral: true });
|
||||
return;
|
||||
}
|
||||
if (!interaction.guildId) {
|
||||
await interaction.deleteReply();
|
||||
await interaction.followUp({ content: INVALID_GUILD_MESSAGE, ephemeral: true });
|
||||
return;
|
||||
}
|
||||
const channels = getChannelsFromInteraction(interaction);
|
||||
await addValidChannels(channels, interaction.guildId);
|
||||
await interaction.editReply(
|
||||
@@ -643,6 +646,11 @@ client.on('interactionCreate', async (interaction) => {
|
||||
await interaction.followUp({ content: INVALID_PERMISSIONS_MESSAGE, ephemeral: true });
|
||||
return;
|
||||
}
|
||||
if (!interaction.guildId) {
|
||||
await interaction.deleteReply();
|
||||
await interaction.followUp({ content: INVALID_GUILD_MESSAGE, ephemeral: true });
|
||||
return;
|
||||
}
|
||||
const channels = getChannelsFromInteraction(interaction);
|
||||
await removeValidChannels(channels, interaction.guildId);
|
||||
await interaction.editReply(
|
||||
|
||||
Reference in New Issue
Block a user