diff --git a/.eslintrc.json b/.eslintrc.json index 6231a7d4..3068c820 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,7 +9,8 @@ "plugins": ["@typescript-eslint", "import"], "parserOptions": { "sourceType": "module", - "ecmaVersion": "latest" + "ecmaVersion": "latest", + "project": true }, "env": { "node": true @@ -21,6 +22,8 @@ "alphabetize": { "order": "asc" }, "newlines-between": "never" } - ] + ], + "@typescript-eslint/restrict-template-expressions": "off", + "@typescript-eslint/no-base-to-string": "off" } } diff --git a/src/commands/join.ts b/src/commands/join.ts index 40ef890e..a0122eb7 100644 --- a/src/commands/join.ts +++ b/src/commands/join.ts @@ -1,3 +1,4 @@ +import { once } from "events"; import { ApplicationCommandOptionType, type ChatInputCommandInteraction, @@ -6,7 +7,6 @@ import { } from "discord.js"; import { ReplyableError } from "../error"; import Pipeline from "../pipeline"; -import { VoiceConnectionStatus, entersState } from "@discordjs/voice"; export const definition = { name: "join", @@ -38,9 +38,6 @@ export async function handler( ); } const pipeline = new Pipeline(channel); - await Promise.all([ - interaction.deferReply(), - entersState(pipeline.connection, VoiceConnectionStatus.Ready, 10_000), - ]); + await Promise.all([interaction.deferReply(), once(pipeline, "ready")]); await interaction.editReply(`${channel}に参加しました。`); } diff --git a/src/main.ts b/src/main.ts index a2be269e..7da30320 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { Client, Events, GatewayIntentBits } from "discord.js"; -import { ReplyableError } from "./error"; import * as join from "./commands/join"; import * as leave from "./commands/leave"; +import { ReplyableError } from "./error"; const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages], @@ -25,4 +25,4 @@ client.on(Events.InteractionCreate, async (interaction) => { } }); -client.login(); +void client.login();