Update dependencies to latest

This commit is contained in:
Charlie Laabs
2022-01-02 15:00:05 -06:00
parent 914c355ad0
commit 92e86eabb9
4 changed files with 267 additions and 396 deletions

View File

@@ -43,7 +43,7 @@ const channelOptionsGenerator = (builder: SlashCommandChannelOption, index: numb
.setName(`channel-${index + 1}`)
.setDescription('A text channel')
.setRequired(index === 0)
.addChannelType(ChannelType.GuildText as any);
.addChannelType(ChannelType.GuildText);
export const listenChannelCommand = new SlashCommandBuilder()
.setName('listen')

View File

@@ -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(