Skip to content

Commit

Permalink
small fixes around eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
cm-ayf committed Oct 16, 2023
1 parent 76d15bf commit 8b6db7e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"plugins": ["@typescript-eslint", "import"],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
"ecmaVersion": "latest",
"project": true
},
"env": {
"node": true
Expand All @@ -21,6 +22,8 @@
"alphabetize": { "order": "asc" },
"newlines-between": "never"
}
]
],
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-base-to-string": "off"
}
}
7 changes: 2 additions & 5 deletions src/commands/join.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { once } from "events";
import {
ApplicationCommandOptionType,
type ChatInputCommandInteraction,
Expand All @@ -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",
Expand Down Expand Up @@ -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}に参加しました。`);
}
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -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],
Expand All @@ -25,4 +25,4 @@ client.on(Events.InteractionCreate, async (interaction) => {
}
});

client.login();
void client.login();

0 comments on commit 8b6db7e

Please sign in to comment.