0
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?

Discord Bot で非Stageボイス接続時に 4017 が出る問題を解決した話(2026年以降 DAVE/E2EE 対応)

0
Posted at

背景

2026年3月1日以降、Discord が 全ての非Stageボイスチャンネルで E2EE(DAVE)を必須化
古い discord.py(2.6.3 以前)は DAVE 非対応のため、接続直後に 4017 エラーで弾かれるようになった。

現象

ログ例:

Voice handshake complete → WebSocket closed with 4017
  • Stage チャンネルは影響なし
  • トークン・Intents・権限・PyNaCl・ネットワークは原因ではない

原因

  • DAVE プロトコル未対応
  • Identify ペイロードに DAVE バージョン情報が無いため、サーバが接続を拒否

解決手順

  1. discord.py を最新にアップデート
pip install -U "discord.py[voice]"
  1. DAVE 実装パッケージ davey をインストール
pip install davey
  1. PyNaCl が適切なバージョンか確認
pip install pynacl==1.5.0
  1. bot を再起動して確認
python bot.py
  1. DAVE が有効か確認
python -m discord --version

出力例:

- Python v3.11.9-final
- discord.py v2.7.1-final
- aiohttp v3.13.3
- davey v0.1.4

注意点

  • Stage チャンネルは対象外
  • トークンや権限の問題ではない
  • 接続ログが「Voice handshake complete → 4017」の場合はこの原因

参考

0
0
0

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
0
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?