Skip to content

Commit

Permalink
Merge pull request #15 from femshima/fix-leave
Browse files Browse the repository at this point in the history
  • Loading branch information
cm-ayf authored Nov 20, 2023
2 parents fdfb51d + dfe27c3 commit 36a0c7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/leave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export async function handler(
if (!pipeline) {
throw new ReplyableError("ボイスチャンネルに参加していません。");
}
pipeline.connection.destroy();
// State change to `destoryed` is done synchronously.
setImmediate(() => pipeline.connection.destroy());
await Promise.all([interaction.deferReply(), once(pipeline, "destroy")]);
await interaction.editReply("退出しました。");
}

0 comments on commit 36a0c7a

Please sign in to comment.