3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Discord.js/voiceで音楽Botを作っている方へ 注意喚起

3
Last updated at Posted at 2023-03-03

Discord音楽Botがバグり始めた

具体的な内容としては、数十秒経過したあとに自動で停止され、解除できないというものです。これはDiscord.jsが悪いわけではなく、Discord API側の仕様のようです。

対策

VoiceConnectionを呼び出した後に

VoiceConnection.on('stateChange', (old_state, new_state) => {
    if (old_state.status === VoiceConnectionStatus.Ready && new_state.status === VoiceConnectionStatus.Connecting) {
        VoiceConnection.configureNetworking();
    }
});

を挿入するだけです。
数十秒ごとに短い沈黙がありますが、まぁ個人開発の用途であれば気にする必要はないでしょう。
なんにせよ、そのうちDiscord.js側で対応してくれると思います。

それまで少し辛抱しましょう。

追記

Discord側でVCのロケーション設定をシンガポールにすると上のコードを追加しないでも普通に再生されるようです。

更に追記

やはりAPI側のようです
image.png

そのうちほぼ確実に修正されるでしょう(discordjs側で)

この変更がかなり重大なイシューを引き起こしたようなので一時的に変更を戻しているようです。
3/16にもう一度有効化されるようなのでDiscord.jsにアプデがくるまで待ちましょう。

3
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?