Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disconnect automatically when no user in voice #53

Merged
merged 10 commits into from
May 11, 2023
Merged

Conversation

mnsinri
Copy link
Contributor

@mnsinri mnsinri commented May 8, 2023

resolve #21

未対応
ずんだもんをvcから切断するとReconnect処理がはしる。
この時に/joinすると、ずんだもんがvcにいないのにAlready joined!と表示される。

@mnsinri mnsinri requested a review from sarisia as a code owner May 8, 2023 17:02
@mnsinri mnsinri marked this pull request as draft May 9, 2023 11:39
@mnsinri mnsinri marked this pull request as ready for review May 9, 2023 13:42
@sarisia
Copy link
Member

sarisia commented May 9, 2023

未対応
ずんだもんをvcから切断するとReconnect処理がはしる。
この時に/joinすると、ずんだもんがvcにいないのにAlready joined!と表示される。

これは正常な仕様で、エラーなどでbotがサーバから切断された場合は自動で再接続が入るので /join できなくても5秒以内に戻ってくれるしいいだろうと思ってます。

(公式ガイドのワークアラウンドをそのまま実装してます。いい方法があったら教えて欲しい)

https://discordjs.guide/voice/voice-connections.html#handling-disconnects

src/zundacord/app.ts Outdated Show resolved Hide resolved
Copy link
Member

@sarisia sarisia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以前に clearTimeout はサーバ単位で複雑だからいらないと言ってしまったけど, やっぱ必要そう. すみません.

class Player がサーバ単位で管理されているので, auto disconnect 機能をこっちに移しつつ, 1サーバにつき auto disconnect タイマーが1つしか走らないように変更してもらえると嬉しいです

@mnsinri mnsinri marked this pull request as draft May 11, 2023 01:15
@mnsinri mnsinri marked this pull request as ready for review May 11, 2023 08:02
src/zundacord/player.ts Outdated Show resolved Hide resolved
src/zundacord/app.ts Show resolved Hide resolved
src/zundacord/player.ts Show resolved Hide resolved
src/zundacord/player.ts Show resolved Hide resolved
@sarisia sarisia merged commit c43d9b3 into aria-music:main May 11, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disconnect automatically when no user in voice
2 participants