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

619
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -30,36 +30,36 @@
},
"license": "MIT",
"dependencies": {
"@discordjs/builders": "^0.9.0",
"@discordjs/builders": "^0.11.0",
"@discordjs/rest": "^0.2.0-canary.0",
"@types/fs-extra": "^9.0.13",
"better-sqlite3": "^7.4.5",
"bufferutil": "^4.0.5",
"better-sqlite3": "^7.4.6",
"bufferutil": "^4.0.6",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"date-fns": "^2.28.0",
"discord-api-types": "^0.25.2",
"discord.js": "^13.3.1",
"discord-api-types": "^0.26.1",
"discord.js": "^13.5.0",
"dotenv": "^10.0.0",
"erlpack": "github:discord/erlpack",
"fs-extra": "^10.0.0",
"json5": "^2.2.0",
"markov-strings-db": "^4.1.4",
"pino": "^7.5.1",
"pino": "^7.6.2",
"pino-pretty": "^7.3.0",
"reflect-metadata": "^0.1.13",
"simple-eta": "^3.0.2",
"source-map-support": "^0.5.21",
"typeorm": "^0.2.38",
"utf-8-validate": "^5.0.7",
"typeorm": "^0.2.41",
"utf-8-validate": "^5.0.8",
"zlib-sync": "^0.1.7"
},
"devDependencies": {
"@types/node": "^16.11.14",
"@types/validator": "^13.7.0",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"eslint": "^8.4.1",
"@types/node": "^16.11.17",
"@types/validator": "^13.7.1",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"eslint": "^8.6.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.3",

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(