Intial Commit

This commit is contained in:
2025-11-12 23:11:11 -05:00
parent 002600c19b
commit 2c9fa9a14c
8 changed files with 2291 additions and 1 deletions

25
.gitignore vendored Normal file
View File

@@ -0,0 +1,25 @@
# Python
__pycache__/
*.pyc
.venv/
venv/
# Env and local config
.env
# Audio artifacts
audio/
tts_output.wav
# OS / IDE
.DS_Store
Thumbs.db
.idea/
.vscode/
# yt-dlp cache
yt-dlp.conf
.cache/

82
README.md Normal file
View File

@@ -0,0 +1,82 @@
## BasharBotV2 (Local audio Discord bot)
A local-first Discord bot you can talk to. It:
- **Joins** your voice channel when you type `hey bashar join`
- **Plays YouTube music** when you say/type `hey bashar play <query>`
- **Speaks** “Playing <title>” with local TTS (pyttsx3)
- Built for Windows; runs entirely **locally** (no external APIs)
### 1) Prerequisites (Windows)
- Python 3.103.12
- FFmpeg in PATH:
- PowerShell (Admin):
```powershell
choco install ffmpeg -y
```
- A Discord bot token created at the Developer Portal
### 2) Setup
```powershell
cd "D:\7. Git\BasharBotV2"
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -U pip
pip install -r requirements.txt
```
Create a `.env` file in the project root:
```
DISCORD_TOKEN=your-bot-token-here
WHISPER_MODEL_SIZE=small
```
Note: The bot uses local TTS via `pyttsx3` (Windows SAPI).
Local STT (Whisper via `faster-whisper`) scaffolding is included and will be wired to live voice in a follow-up edit.
### 3) Run
```powershell
.venv\Scripts\Activate.ps1
python bot.py
```
### 4) Use
In any text channel in your server:
- `hey bashar join` — the bot joins your current voice channel.
- `hey bashar play never gonna give you up` — bot speaks “Playing …” and streams the top YouTube result.
- `hey bashar skip` — skips the current track but keeps the queue.
- `hey bashar stop` — stops playback and clears the queue.
- `hey bashar leave` — disconnects from voice.
Speech (local STT via faster-whisper):
- Send a voice message or audio file attachment that starts with your wake word in speech:
- Example voice: “hey bashar play never gonna give you up”
- The bot transcribes locally and executes the command.
- Spoken `skip`/`stop` commands work the same way.
- The wake word is tolerant (“hey bashar” / “hey bishar” / “hey vishar”, etc.) so mispronunciations still trigger the bot.
Live hotword listening (wake word):
- Enabled by default. After `hey bashar join`, the bot listens continuously for “hey bashar …”, even while music is playing, and reacts almost immediately (no more 5second clips).
- Say “hey bashar leave” to stop listening and disconnect.
- Voice receive needs Opus on your machine. On Windows install Opus via `pip install opuslib` (shown below) or drop an `opus.dll` beside `python.exe`. If you still see “Opus library not found”, set `OPUS_LIB=C:\Path\To\opus.dll` in `.env`.
- Verifying Opus (Windows PowerShell):
```powershell
.venv\Scripts\Activate.ps1
pip install opuslib
```
- To disable the listener, set `HOTWORD_ENABLED=false` in `.env`.
- Optional voice reactions:
- Set `GOODBOY_USER_ID` in `.env` (default: `94578724413902848`). When that user speaks a complete English sentence, the bot queues `goodboy.ogg` locally.
- Logging control via `.env`:
- `TRANSCRIPT_LOG_ENABLED=true/false`
- `TRANSCRIPT_LOG_PATH=custom/transcript/path.log`
You can queue more tracks by repeating `hey bashar play ...`. The bot handles reconnectable streams.
### 5) Notes
- All processing is local. YouTube audio is streamed via `yt-dlp` + `ffmpeg`.
- Library: now using `discord.py` 2.x (voice enabled with `PyNaCl`).
- If you get an FFmpeg error, confirm its in PATH:
`ffmpeg -version`

1
Test
View File

@@ -1 +0,0 @@
ss

834
bot.log Normal file
View File

@@ -0,0 +1,834 @@
22:54:36 [DEBUG] asyncio: Using proactor: IocpProactor
22:54:36 [INFO] discord.client: logging in using static token
22:54:37 [INFO] discord.gateway: Shard ID None has sent the IDENTIFY payload.
22:54:38 [INFO] discord.gateway: Shard ID None has connected to Gateway: ["gateway-prd-arm-us-east1-d-n1d3",{"micros":1669050,"calls":["id_created",{"micros":395,"calls":[]},"session_lookup_time",{"micros":846,"calls":[]},"session_lookup_finished",{"micros":11,"calls":[]},"discord-sessions-prd-2-27",{"micros":1667557,"calls":["start_session",{"micros":1652667,"calls":["discord-api-rpc-6655fff5f-6d5d7",{"micros":1496243,"calls":["get_user",{"micros":32963},"get_guilds",{"micros":4238},"send_scheduled_deletion_message",{"micros":11},"guild_join_requests",{"micros":2},"authorized_ip_coro",{"micros":12},"pending_payments",{"micros":62429},"apex_experiments",{"micros":58529},"user_activities",{"micros":7},"played_application_ids",{"micros":4},"linked_users",{"micros":3}]}]},"starting_guild_connect",{"micros":36,"calls":[]},"presence_started",{"micros":231,"calls":[]},"guilds_started",{"micros":52,"calls":[]},"lobbies_started",{"micros":1,"calls":[]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":14549,"calls":[]},"connect_finished",{"micros":14555,"calls":[]},"build_ready",{"micros":13,"calls":[]},"clean_ready",{"micros":0,"calls":[]},"optimize_ready",{"micros":0,"calls":[]},"split_ready",{"micros":1,"calls":[]}]}]}] (Session ID: a4edf3c8dcbd62e09a2a9a04bc3c5bbe).
22:54:40 [INFO] basharbot: Logged in as Bashar Al-Assad Version 2#4174 (id=1014194017346531419)
22:54:40 [DEBUG] basharbot: ffmpeg found: C:\ProgramData\chocolatey\bin\ffmpeg.EXE
22:54:40 [WARNING] basharbot: Opus library not found; install opuslib/opus-tools if voice receive misbehaves.
22:54:40 [INFO] basharbot: Startup checks OK
22:54:40 [INFO] basharbot: Hotword listening: ENABLED (sinks available and HOTWORD_ENABLED=True)
22:54:41 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:54:41 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:54:41 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:54:41 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/4)
22:54:41 [INFO] discord.voice_client: Connecting to voice...
22:54:41 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:54:41 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:54:41 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:54:42 [ERROR] discord.voice_client: Failed to connect to voice... Retrying...
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:54:43 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:54:43 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 2)
22:54:43 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:54:43 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:54:43 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:54:44 [ERROR] discord.voice_client: Failed to connect to voice... Retrying...
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:54:47 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:54:47 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 3)
22:54:47 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:54:47 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:54:47 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:54:48 [ERROR] discord.voice_client: Failed to connect to voice... Retrying...
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:54:53 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:54:53 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 4)
22:54:53 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:54:53 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:54:54 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:54:54 [ERROR] discord.voice_client: Failed to connect to voice... Retrying...
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:55:01 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:55:01 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 5)
22:55:01 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:55:02 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:55:02 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:55:03 [ERROR] discord.voice_client: Failed to connect to voice... Retrying...
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:55:12 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:55:12 [INFO] basharbot: Voice connect succeeded on attempt 1 (penisary contact with her volvo)
22:55:12 [ERROR] basharbot: Voice connect returned but not connected (guild 763932345400950865)
22:55:12 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:55:12 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:55:12 [INFO] basharbot: Joined voice channel for guild 763932345400950865
22:55:12 [DEBUG] basharbot: Cannot start listener without an active voice client (guild 763932345400950865)
22:55:12 [ERROR] discord.state: Exception occurred during Voice Protocol voice server update handler
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\state.py", line 151, in logging_coroutine
await coroutine
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 340, in on_voice_server_update
await self.ws.close(4000)
AttributeError: '_MissingSentinel' object has no attribute 'close'
22:55:22 [INFO] discord.client: Received signal to terminate bot and event loop.
22:55:22 [INFO] discord.client: Cleaning up tasks.
22:55:22 [INFO] discord.client: Cleaning up after 1 tasks.
22:55:22 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:55:22 [INFO] discord.client: All tasks finished cancelling.
22:55:22 [INFO] discord.client: Closing the event loop.
22:57:22 [DEBUG] asyncio: Using proactor: IocpProactor
22:57:22 [INFO] discord.client: logging in using static token
22:57:23 [INFO] discord.gateway: Shard ID None has sent the IDENTIFY payload.
22:57:23 [INFO] discord.gateway: Shard ID None has connected to Gateway: ["gateway-prd-arm-us-east1-b-pg2d",{"micros":170426,"calls":["id_created",{"micros":448,"calls":[]},"session_lookup_time",{"micros":1230,"calls":[]},"session_lookup_finished",{"micros":9,"calls":[]},"discord-sessions-prd-2-1",{"micros":167983,"calls":["start_session",{"micros":140405,"calls":["discord-api-rpc-6655fff5f-rrdvf",{"micros":45668,"calls":["get_user",{"micros":8044},"get_guilds",{"micros":2872},"send_scheduled_deletion_message",{"micros":15},"guild_join_requests",{"micros":381},"authorized_ip_coro",{"micros":12},"pending_payments",{"micros":56212},"apex_experiments",{"micros":20615},"user_activities",{"micros":5},"played_application_ids",{"micros":3},"linked_users",{"micros":2}]}]},"starting_guild_connect",{"micros":31,"calls":[]},"presence_started",{"micros":3023,"calls":[]},"guilds_started",{"micros":66,"calls":[]},"lobbies_started",{"micros":1,"calls":[]},"guilds_connect",{"micros":2,"calls":[]},"presence_connect",{"micros":24433,"calls":[]},"connect_finished",{"micros":24442,"calls":[]},"build_ready",{"micros":13,"calls":[]},"clean_ready",{"micros":1,"calls":[]},"optimize_ready",{"micros":0,"calls":[]},"split_ready",{"micros":0,"calls":[]}]}]}] (Session ID: e93a554855fde7b36468115efa09bfdd).
22:57:25 [INFO] basharbot: Logged in as Bashar Al-Assad Version 2#4174 (id=1014194017346531419)
22:57:25 [DEBUG] basharbot: ffmpeg found: C:\ProgramData\chocolatey\bin\ffmpeg.EXE
22:57:25 [WARNING] basharbot: Opus library not found; install opuslib/opus-tools if voice receive misbehaves.
22:57:25 [INFO] basharbot: Startup checks OK
22:57:25 [INFO] basharbot: Hotword listening: ENABLED (sinks available and HOTWORD_ENABLED=True)
22:57:27 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:27 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:27 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:28 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:28 [INFO] discord.voice_client: Connecting to voice...
22:57:28 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:28 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:28 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:57:29 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
22:57:29 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:29 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:29 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:29 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:29 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:57:32 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
22:57:32 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:57:32 [INFO] discord.voice_client: Connecting to voice...
22:57:32 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:32 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:33 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:57:33 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
22:57:33 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:33 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:33 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:33 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:34 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:57:45 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:45 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:45 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
22:57:45 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:46 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:46 [INFO] discord.voice_client: Connecting to voice...
22:57:46 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:46 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:46 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:46 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:46 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:46 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:46 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:46 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:46 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:46 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:46 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:46 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:46 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
22:57:46 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:46 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:46 [INFO] discord.voice_client: Connecting to voice...
22:57:46 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:46 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:47 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:57:47 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:47 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:47 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:47 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:47 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:47 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:47 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:47 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:47 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
22:57:47 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:47 [INFO] discord.voice_client: Connecting to voice...
22:57:47 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:47 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:47 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:47 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:47 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:47 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:47 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:47 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:47 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:47 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:47 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
22:57:47 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:47 [INFO] discord.voice_client: Connecting to voice...
22:57:47 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:47 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:47 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:47 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:47 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:47 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:47 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:47 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:47 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:47 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:47 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
22:57:47 [DEBUG] basharbot: Cleared lingering voice state for guild 763932345400950865 during cleanup
22:57:48 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:48 [INFO] discord.voice_client: Connecting to voice...
22:57:48 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:48 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:48 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:48 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:48 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:48 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:48 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:48 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:48 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:48 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:48 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
22:57:48 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:48 [INFO] discord.voice_client: Connecting to voice...
22:57:48 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:48 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:48 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:48 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:48 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:48 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:48 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:48 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:48 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:57:48 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:57:48 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:48 [INFO] discord.voice_client: Connecting to voice...
22:57:48 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:48 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
22:57:48 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
22:57:48 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:48 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:48 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:48 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
22:57:48 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:48 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:57:48 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:48 [INFO] discord.voice_client: Connecting to voice...
22:57:48 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:48 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:49 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:57:49 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:49 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:49 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:49 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:49 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
22:57:49 [INFO] discord.voice_client: Connecting to voice...
22:57:49 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:49 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:49 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:49 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:57:50 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
22:57:50 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:50 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:50 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:50 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:50 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
22:57:50 [DEBUG] basharbot: Cleared lingering voice state for guild 763932345400950865 during cleanup
22:57:50 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:57:50 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:57:51 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:57:51 [INFO] discord.voice_client: Connecting to voice...
22:57:51 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:51 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:51 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:57:52 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
22:57:52 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:52 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:52 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:52 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:52 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:57:53 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
22:57:53 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:57:53 [INFO] discord.voice_client: Connecting to voice...
22:57:53 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:53 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:53 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:57:53 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:57:53 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:53 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:53 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:53 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:57:53 [INFO] discord.voice_client: Connecting to voice...
22:57:53 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:57:53 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:53 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:57:54 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:57:54 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
22:57:54 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:57:54 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:57:54 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:57:54 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:57:55 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:57:55 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
22:57:55 [DEBUG] basharbot: Cleared lingering voice state for guild 763932345400950865 during cleanup
22:57:55 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:58:11 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:11 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:11 [ERROR] basharbot: Voice connect raised on attempt 1/2
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 396, in connect
await utils.sane_wait_for(futures, timeout=timeout)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\utils.py", line 721, in sane_wait_for
raise asyncio.TimeoutError()
asyncio.exceptions.TimeoutError
22:58:11 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:58:12 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:12 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:12 [ERROR] basharbot: Voice connect raised on attempt 1/2
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 396, in connect
await utils.sane_wait_for(futures, timeout=timeout)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\utils.py", line 721, in sane_wait_for
raise asyncio.TimeoutError()
asyncio.exceptions.TimeoutError
22:58:12 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:12 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:12 [ERROR] basharbot: Voice connect raised on attempt 1/2
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 396, in connect
await utils.sane_wait_for(futures, timeout=timeout)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\utils.py", line 721, in sane_wait_for
raise asyncio.TimeoutError()
asyncio.exceptions.TimeoutError
22:58:12 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:58:13 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:13 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:13 [ERROR] basharbot: Voice connect raised on attempt 1/2
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 396, in connect
await utils.sane_wait_for(futures, timeout=timeout)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\utils.py", line 721, in sane_wait_for
raise asyncio.TimeoutError()
asyncio.exceptions.TimeoutError
22:58:13 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:58:13 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:13 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:13 [ERROR] basharbot: Voice connect raised on attempt 1/2
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 396, in connect
await utils.sane_wait_for(futures, timeout=timeout)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\utils.py", line 721, in sane_wait_for
raise asyncio.TimeoutError()
asyncio.exceptions.TimeoutError
22:58:13 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:58:13 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:13 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:13 [ERROR] basharbot: Voice connect raised on attempt 1/2
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 396, in connect
await utils.sane_wait_for(futures, timeout=timeout)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\utils.py", line 721, in sane_wait_for
raise asyncio.TimeoutError()
asyncio.exceptions.TimeoutError
22:58:13 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:58:14 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
22:58:14 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:58:14 [INFO] discord.voice_client: Connecting to voice...
22:58:14 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:58:14 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:58:15 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:58:15 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:58:15 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:15 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:58:15 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:58:15 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:58:15 [INFO] discord.voice_client: Connecting to voice...
22:58:15 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:58:15 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
22:58:15 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:15 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:58:15 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:58:15 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:58:15 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:58:16 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:58:16 [INFO] discord.voice_client: Connecting to voice...
22:58:16 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:58:16 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:58:16 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:58:16 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:58:16 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:58:16 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:16 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:58:16 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:58:16 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:58:16 [INFO] discord.voice_client: Connecting to voice...
22:58:16 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:58:16 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:58:16 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:58:16 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:58:16 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:16 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:58:16 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:58:16 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:58:16 [INFO] discord.voice_client: Connecting to voice...
22:58:16 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:58:16 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:58:16 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
22:58:16 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
22:58:17 [DEBUG] basharbot: Detected stale voice client handle for guild 763932345400950865; cleaning up before reuse
22:58:17 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:17 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:58:17 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
22:58:17 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
22:58:17 [INFO] discord.voice_client: Connecting to voice...
22:58:17 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
22:58:17 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
22:58:17 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
22:58:17 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
22:58:17 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:58:17 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
22:58:17 [INFO] basharbot: Voice state update (guild 763932345400950865): penisary contact with her volvo -> None (self_mute=False deaf=False)
22:58:17 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:58:17 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
22:58:18 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
22:58:29 [WARNING] discord.gateway: Shard ID None has stopped responding to the gateway. Closing and restarting.
22:58:33 [WARNING] discord.gateway: Shard ID None has stopped responding to the gateway. Closing and restarting.
22:58:34 [INFO] discord.client: Received signal to terminate bot and event loop.
22:58:34 [INFO] discord.client: Cleaning up tasks.
22:58:34 [INFO] discord.client: Cleaning up after 17 tasks.
22:58:34 [INFO] discord.client: All tasks finished cancelling.
22:58:34 [INFO] discord.client: Closing the event loop.
23:02:02 [DEBUG] asyncio: Using proactor: IocpProactor
23:02:02 [INFO] discord.client: logging in using static token
23:02:03 [INFO] discord.gateway: Shard ID None has sent the IDENTIFY payload.
23:02:03 [INFO] discord.gateway: Shard ID None has connected to Gateway: ["gateway-prd-arm-us-east1-c-fm76",{"micros":259222,"calls":["id_created",{"micros":499,"calls":[]},"session_lookup_time",{"micros":6930,"calls":[]},"session_lookup_finished",{"micros":10,"calls":[]},"discord-sessions-prd-2-83",{"micros":251294,"calls":["start_session",{"micros":240690,"calls":["discord-api-rpc-7bb4cd58cb-992xx",{"micros":94850,"calls":["get_user",{"micros":36846},"get_guilds",{"micros":4073},"send_scheduled_deletion_message",{"micros":24},"guild_join_requests",{"micros":989},"authorized_ip_coro",{"micros":16},"pending_payments",{"micros":55765},"apex_experiments",{"micros":77320},"user_activities",{"micros":6},"played_application_ids",{"micros":3},"linked_users",{"micros":3}]}]},"starting_guild_connect",{"micros":30,"calls":[]},"presence_started",{"micros":347,"calls":[]},"guilds_started",{"micros":57,"calls":[]},"lobbies_started",{"micros":1,"calls":[]},"guilds_connect",{"micros":2,"calls":[]},"presence_connect",{"micros":10134,"calls":[]},"connect_finished",{"micros":10154,"calls":[]},"build_ready",{"micros":12,"calls":[]},"clean_ready",{"micros":1,"calls":[]},"optimize_ready",{"micros":0,"calls":[]},"split_ready",{"micros":1,"calls":[]}]}]}] (Session ID: d470797968f07f6fbe8932acee60e614).
23:02:05 [INFO] basharbot: Logged in as Bashar Al-Assad Version 2#4174 (id=1014194017346531419)
23:02:05 [DEBUG] basharbot: ffmpeg found: C:\ProgramData\chocolatey\bin\ffmpeg.EXE
23:02:05 [WARNING] basharbot: Opus library not found; install opuslib/opus-tools if voice receive misbehaves.
23:02:05 [INFO] basharbot: Startup checks OK
23:02:05 [INFO] basharbot: Hotword listening: ENABLED (sinks available and HOTWORD_ENABLED=True)
23:02:09 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
23:02:09 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
23:02:09 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
23:02:10 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
23:02:10 [INFO] discord.voice_client: Connecting to voice...
23:02:10 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:02:10 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:02:10 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
23:02:11 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
23:02:11 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
23:02:11 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
23:02:11 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
23:02:11 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:02:11 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
23:02:14 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
23:02:14 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
23:02:14 [INFO] discord.voice_client: Connecting to voice...
23:02:14 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:02:15 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:02:15 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
23:02:16 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
23:02:16 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
23:02:16 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
23:02:16 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
23:02:16 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:02:16 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
23:03:11 [WARNING] discord.gateway: Shard ID None has stopped responding to the gateway. Closing and restarting.
23:03:15 [WARNING] discord.gateway: Shard ID None has stopped responding to the gateway. Closing and restarting.
23:04:10 [INFO] discord.client: Received signal to terminate bot and event loop.
23:04:10 [INFO] discord.client: Cleaning up tasks.
23:04:10 [INFO] discord.client: Cleaning up after 1 tasks.
23:04:10 [INFO] discord.client: All tasks finished cancelling.
23:04:10 [INFO] discord.client: Closing the event loop.
23:04:17 [DEBUG] asyncio: Using proactor: IocpProactor
23:04:17 [INFO] discord.client: logging in using static token
23:04:18 [INFO] discord.gateway: Shard ID None has sent the IDENTIFY payload.
23:04:18 [INFO] discord.gateway: Shard ID None has connected to Gateway: ["gateway-prd-arm-us-east1-d-nhmv",{"micros":163493,"calls":["id_created",{"micros":471,"calls":[]},"session_lookup_time",{"micros":1464,"calls":[]},"session_lookup_finished",{"micros":12,"calls":[]},"discord-sessions-prd-2-48",{"micros":161191,"calls":["start_session",{"micros":126626,"calls":["discord-api-rpc-7bb4cd58cb-zm2h7",{"micros":54974,"calls":["get_user",{"micros":5380},"get_guilds",{"micros":3405},"send_scheduled_deletion_message",{"micros":66},"guild_join_requests",{"micros":4},"authorized_ip_coro",{"micros":12},"pending_payments",{"micros":56692},"apex_experiments",{"micros":4683},"user_activities",{"micros":7},"played_application_ids",{"micros":4},"linked_users",{"micros":3}]}]},"starting_guild_connect",{"micros":31,"calls":[]},"presence_started",{"micros":7196,"calls":[]},"guilds_started",{"micros":52,"calls":[]},"lobbies_started",{"micros":1,"calls":[]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":27261,"calls":[]},"connect_finished",{"micros":27269,"calls":[]},"build_ready",{"micros":13,"calls":[]},"clean_ready",{"micros":1,"calls":[]},"optimize_ready",{"micros":0,"calls":[]},"split_ready",{"micros":1,"calls":[]}]}]}] (Session ID: cc32b08f7fe9da7d3ca9fc376d47999c).
23:04:20 [INFO] basharbot: Logged in as Bashar Al-Assad Version 2#4174 (id=1014194017346531419)
23:04:20 [DEBUG] basharbot: ffmpeg found: C:\ProgramData\chocolatey\bin\ffmpeg.EXE
23:04:20 [WARNING] basharbot: Opus library not found; install opuslib/opus-tools if voice receive misbehaves.
23:04:20 [INFO] basharbot: Startup checks OK
23:04:20 [INFO] basharbot: Hotword listening: ENABLED (sinks available and HOTWORD_ENABLED=True)
23:04:24 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
23:04:24 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
23:04:24 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
23:04:24 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
23:04:24 [INFO] discord.voice_client: Connecting to voice...
23:04:24 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:04:24 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:04:25 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
23:04:25 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
23:04:25 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
23:04:25 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
23:04:25 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
23:04:25 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:04:26 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
23:04:29 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
23:04:29 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
23:04:29 [INFO] discord.voice_client: Connecting to voice...
23:04:29 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:04:29 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:04:29 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-nrt12-942f95a0.discord.media
23:04:30 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
23:04:30 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
23:04:30 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
23:04:30 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
23:04:30 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:04:30 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
23:05:25 [WARNING] discord.gateway: Shard ID None has stopped responding to the gateway. Closing and restarting.
23:05:30 [WARNING] discord.gateway: Shard ID None has stopped responding to the gateway. Closing and restarting.
23:06:07 [INFO] discord.client: Received signal to terminate bot and event loop.
23:06:07 [INFO] discord.client: Cleaning up tasks.
23:06:07 [INFO] discord.client: Cleaning up after 1 tasks.
23:06:07 [INFO] discord.client: All tasks finished cancelling.
23:06:07 [INFO] discord.client: Closing the event loop.
23:06:11 [DEBUG] asyncio: Using proactor: IocpProactor
23:06:11 [INFO] discord.client: logging in using static token
23:06:11 [INFO] discord.gateway: Shard ID None has sent the IDENTIFY payload.
23:06:11 [INFO] discord.gateway: Shard ID None has connected to Gateway: ["gateway-prd-arm-us-east1-d-kd59",{"micros":148219,"calls":["id_created",{"micros":671,"calls":[]},"session_lookup_time",{"micros":228,"calls":[]},"session_lookup_finished",{"micros":7,"calls":[]},"discord-sessions-prd-2-123",{"micros":146923,"calls":["start_session",{"micros":125803,"calls":["discord-api-rpc-7bb4cd58cb-k7rvk",{"micros":41197,"calls":["get_user",{"micros":11194},"get_guilds",{"micros":1897},"send_scheduled_deletion_message",{"micros":12},"guild_join_requests",{"micros":422},"authorized_ip_coro",{"micros":10},"pending_payments",{"micros":56242},"apex_experiments",{"micros":4961},"user_activities",{"micros":7},"played_application_ids",{"micros":3},"linked_users",{"micros":4}]}]},"starting_guild_connect",{"micros":33,"calls":[]},"presence_started",{"micros":1308,"calls":[]},"guilds_started",{"micros":53,"calls":[]},"lobbies_started",{"micros":2,"calls":[]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":19689,"calls":[]},"connect_finished",{"micros":19708,"calls":[]},"build_ready",{"micros":15,"calls":[]},"clean_ready",{"micros":0,"calls":[]},"optimize_ready",{"micros":0,"calls":[]},"split_ready",{"micros":0,"calls":[]}]}]}] (Session ID: c2002617afb42be2f14e30a597c93f7d).
23:06:13 [INFO] basharbot: Logged in as Bashar Al-Assad Version 2#4174 (id=1014194017346531419)
23:06:13 [DEBUG] basharbot: ffmpeg found: C:\ProgramData\chocolatey\bin\ffmpeg.EXE
23:06:13 [WARNING] basharbot: Opus library not found; install opuslib/opus-tools if voice receive misbehaves.
23:06:13 [INFO] basharbot: Startup checks OK
23:06:13 [INFO] basharbot: Hotword listening: ENABLED (sinks available and HOTWORD_ENABLED=True)
23:06:16 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
23:06:16 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
23:06:16 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
23:06:16 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
23:06:16 [INFO] discord.voice_client: Connecting to voice...
23:06:16 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:06:16 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:06:17 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-bom12-7cf82593.discord.media
23:06:18 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
23:06:18 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
23:06:18 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
23:06:18 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
23:06:18 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:06:19 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
23:06:22 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
23:06:22 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
23:06:22 [INFO] discord.voice_client: Connecting to voice...
23:06:22 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:06:22 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:06:22 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-bom12-7cf82593.discord.media
23:06:23 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
23:06:23 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
23:06:23 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
23:06:23 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
23:06:23 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:06:23 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
23:06:33 [INFO] discord.client: Received signal to terminate bot and event loop.
23:06:33 [INFO] discord.client: Cleaning up tasks.
23:06:33 [INFO] discord.client: Cleaning up after 1 tasks.
23:06:33 [INFO] discord.client: All tasks finished cancelling.
23:06:33 [INFO] discord.client: Closing the event loop.
23:07:43 [DEBUG] asyncio: Using proactor: IocpProactor
23:07:43 [INFO] discord.client: logging in using static token
23:07:43 [INFO] discord.gateway: Shard ID None has sent the IDENTIFY payload.
23:07:43 [INFO] discord.gateway: Shard ID None has connected to Gateway: ["gateway-prd-arm-us-east1-b-c88w",{"micros":140067,"calls":["id_created",{"micros":652,"calls":[]},"session_lookup_time",{"micros":307,"calls":[]},"session_lookup_finished",{"micros":10,"calls":[]},"discord-sessions-prd-2-136",{"micros":138132,"calls":["start_session",{"micros":134164,"calls":["discord-api-rpc-7bb4cd58cb-vp2zs",{"micros":49810,"calls":["get_user",{"micros":7051},"get_guilds",{"micros":4627},"send_scheduled_deletion_message",{"micros":25},"guild_join_requests",{"micros":13},"authorized_ip_coro",{"micros":119},"pending_payments",{"micros":71819},"apex_experiments",{"micros":3493},"user_activities",{"micros":5},"played_application_ids",{"micros":3},"linked_users",{"micros":3}]}]},"starting_guild_connect",{"micros":32,"calls":[]},"presence_started",{"micros":267,"calls":[]},"guilds_started",{"micros":56,"calls":[]},"lobbies_started",{"micros":10,"calls":[]},"guilds_connect",{"micros":3,"calls":[]},"presence_connect",{"micros":3579,"calls":[]},"connect_finished",{"micros":3588,"calls":[]},"build_ready",{"micros":13,"calls":[]},"clean_ready",{"micros":0,"calls":[]},"optimize_ready",{"micros":1,"calls":[]},"split_ready",{"micros":0,"calls":[]}]}]}] (Session ID: 7db50e74307181ab1e9626ac8f6d151a).
23:07:45 [INFO] basharbot: Logged in as Bashar Al-Assad Version 2#4174 (id=1014194017346531419)
23:07:45 [DEBUG] basharbot: ffmpeg found: C:\ProgramData\chocolatey\bin\ffmpeg.EXE
23:07:45 [WARNING] basharbot: Opus library not found; install opuslib/opus-tools if voice receive misbehaves.
23:07:45 [INFO] basharbot: Startup checks OK
23:07:45 [INFO] basharbot: Hotword listening: ENABLED (sinks available and HOTWORD_ENABLED=True)
23:07:49 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
23:07:49 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
23:07:49 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
23:07:50 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
23:07:50 [INFO] discord.voice_client: Connecting to voice...
23:07:50 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:07:50 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:07:50 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-bom12-7cf82593.discord.media
23:07:51 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
23:07:51 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
23:07:51 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
23:07:51 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
23:07:51 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:07:52 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
23:07:55 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
23:07:55 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
23:07:55 [INFO] discord.voice_client: Connecting to voice...
23:07:55 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:07:55 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:07:55 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-bom12-7cf82593.discord.media
23:07:56 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
23:07:56 [INFO] discord.voice_client: The voice handshake is being terminated for Channel ID 832692051811369022 (Guild ID 763932345400950865)
23:07:56 [DEBUG] basharbot: Forced voice disconnect to clear stale session (guild 763932345400950865)
23:07:56 [DEBUG] basharbot: Cleared lingering voice state post-disconnect for guild 763932345400950865
23:07:56 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:07:57 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 913, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 468, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 414, in connect_voice_with_retry
vc = await channel.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
23:08:05 [INFO] discord.client: Received signal to terminate bot and event loop.
23:08:05 [INFO] discord.client: Cleaning up tasks.
23:08:05 [INFO] discord.client: Cleaning up after 1 tasks.
23:08:05 [INFO] discord.client: All tasks finished cancelling.
23:08:05 [INFO] discord.client: Closing the event loop.
23:09:31 [DEBUG] asyncio: Using proactor: IocpProactor
23:09:31 [INFO] discord.client: logging in using static token
23:09:31 [INFO] discord.gateway: Shard ID None has sent the IDENTIFY payload.
23:09:32 [INFO] discord.gateway: Shard ID None has connected to Gateway: ["gateway-prd-arm-us-east1-d-x9h4",{"micros":244067,"calls":["id_created",{"micros":418,"calls":[]},"session_lookup_time",{"micros":2209,"calls":[]},"session_lookup_finished",{"micros":11,"calls":[]},"discord-sessions-prd-2-3",{"micros":241168,"calls":["start_session",{"micros":221022,"calls":["discord-api-rpc-7bb4cd58cb-h9pqf",{"micros":136741,"calls":["get_user",{"micros":31935},"get_guilds",{"micros":2834},"send_scheduled_deletion_message",{"micros":13},"guild_join_requests",{"micros":2756},"authorized_ip_coro",{"micros":14},"pending_payments",{"micros":49634},"apex_experiments",{"micros":3574},"user_activities",{"micros":5},"played_application_ids",{"micros":3},"linked_users",{"micros":2}]}]},"starting_guild_connect",{"micros":28,"calls":[]},"presence_started",{"micros":222,"calls":[]},"guilds_started",{"micros":58,"calls":[]},"lobbies_started",{"micros":1,"calls":[]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":19805,"calls":[]},"connect_finished",{"micros":19824,"calls":[]},"build_ready",{"micros":12,"calls":[]},"clean_ready",{"micros":0,"calls":[]},"optimize_ready",{"micros":0,"calls":[]},"split_ready",{"micros":0,"calls":[]}]}]}] (Session ID: 94104bff8f38973ea0719562a1e529b5).
23:09:34 [INFO] basharbot: Logged in as Bashar Al-Assad Version 2#4174 (id=1014194017346531419)
23:09:34 [DEBUG] basharbot: ffmpeg found: C:\ProgramData\chocolatey\bin\ffmpeg.EXE
23:09:34 [WARNING] basharbot: Opus library not found; install opuslib/opus-tools if voice receive misbehaves.
23:09:34 [INFO] basharbot: Startup checks OK
23:09:34 [INFO] basharbot: Hotword listening: ENABLED (sinks available and HOTWORD_ENABLED=True)
23:09:41 [DEBUG] basharbot: Wake word detected. Raw='hey bashar join' | action='join' | args=''
23:09:41 [DEBUG] basharbot: Connect requested by riggs0 (Riggs0) in guild 763932345400950865
23:09:41 [INFO] basharbot: Connecting to voice channel: penisary contact with her volvo (guild 763932345400950865)
23:09:42 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 1/2)
23:09:42 [INFO] discord.voice_client: Connecting to voice...
23:09:42 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:09:42 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:09:42 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-bom12-7cf82593.discord.media
23:09:43 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 1/2
23:09:43 [DEBUG] basharbot: Cleared lingering voice state for guild 763932345400950865 during cleanup
23:09:43 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:09:44 [INFO] basharbot: Waiting 3.0s before retry 2 (guild 763932345400950865)
23:09:47 [DEBUG] basharbot: Detected lingering voice state without client for guild 763932345400950865; clearing before reconnect
23:09:47 [INFO] basharbot: Attempting voice connect to penisary contact with her volvo (attempt 2/2)
23:09:47 [INFO] discord.voice_client: Connecting to voice...
23:09:47 [INFO] discord.voice_client: Starting voice handshake... (connection attempt 1)
23:09:47 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> penisary contact with her volvo (self_mute=False deaf=False)
23:09:47 [INFO] discord.voice_client: Voice handshake complete. Endpoint found c-bom12-7cf82593.discord.media
23:09:48 [WARNING] basharbot: Voice connect failed with ConnectionClosed(code=4006, reason=) on attempt 2/2
23:09:48 [DEBUG] basharbot: Cleared lingering voice state for guild 763932345400950865 during cleanup
23:09:48 [INFO] basharbot: Voice state update (guild 763932345400950865): None -> None (self_mute=False deaf=False)
23:09:49 [ERROR] basharbot: Voice connect retries exhausted (guild 763932345400950865): Shard ID None WebSocket closed with 4006
Traceback (most recent call last):
File "D:\7. Git\BasharBotV2\bot.py", line 939, in connect_to_author_channel
vc = await connect_voice_with_retry(channel)
File "D:\7. Git\BasharBotV2\bot.py", line 494, in connect_voice_with_retry
raise last_exc
File "D:\7. Git\BasharBotV2\bot.py", line 433, in connect_voice_with_retry
await voice_client.connect(timeout=25.0, reconnect=False)
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "D:\7. Git\BasharBotV2\.venv\lib\site-packages\discord\gateway.py", line 955, in poll_event
raise ConnectionClosed(self.ws, shard_id=None, code=self._close_code)
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006
23:09:51 [INFO] discord.client: Received signal to terminate bot and event loop.
23:09:51 [INFO] discord.client: Cleaning up tasks.
23:09:51 [INFO] discord.client: Cleaning up after 1 tasks.
23:09:51 [INFO] discord.client: All tasks finished cancelling.
23:09:51 [INFO] discord.client: Closing the event loop.

1304
bot.py Normal file

File diff suppressed because it is too large Load Diff

BIN
goodboy.ogg Normal file

Binary file not shown.

11
requirements.txt Normal file
View File

@@ -0,0 +1,11 @@
discord.py>=2.4.0
PyNaCl==1.5.0
yt-dlp==2025.8.11
pyttsx3==2.90
faster-whisper==1.0.3
soundfile==0.12.1
numpy==1.26.4
python-dotenv==1.0.1
requests>=2.31.0

35
stt.py Normal file
View File

@@ -0,0 +1,35 @@
import os
from typing import Optional, Tuple, List
from faster_whisper import WhisperModel
_model_singleton: Optional[WhisperModel] = None
def get_model() -> WhisperModel:
global _model_singleton
if _model_singleton is None:
model_size = os.getenv("WHISPER_MODEL_SIZE", "small")
# CPU-friendly defaults; set compute_type="int8" for lower RAM
_model_singleton = WhisperModel(model_size, device="cpu", compute_type="int8")
return _model_singleton
def transcribe_file(audio_path: str) -> Tuple[str, float]:
"""
Transcribe an audio file to text locally using faster-whisper.
Returns (text, avg_logprob).
"""
model = get_model()
segments, info = model.transcribe(audio_path, beam_size=1, vad_filter=True)
text_parts: List[str] = []
for seg in segments:
text_parts.append(seg.text.strip())
text = " ".join(part for part in text_parts if part)
avg_logprob = getattr(info, "avg_logprob", 0.0) if info is not None else 0.0
return text.strip(), float(avg_logprob)