Merge origin/main; warn on partial proxy credentials; add only-password test

- Merged latest main (no conflicts)
- Added warning log when only one of proxy_username/proxy_password is set
- Added test_start_no_proxy_auth_when_only_password for coverage parity

Made-with: Cursor
This commit is contained in:
Xubin Ren
2026-04-09 23:54:11 +08:00
committed by Xubin Ren
parent 7506af7104
commit 69d748bf8f
2 changed files with 30 additions and 1 deletions
+8 -1
View File
@@ -308,13 +308,20 @@ class DiscordChannel(BaseChannel):
intents.value = self.config.intents
proxy_auth = None
if self.config.proxy_username and self.config.proxy_password:
has_user = bool(self.config.proxy_username)
has_pass = bool(self.config.proxy_password)
if has_user and has_pass:
import aiohttp
proxy_auth = aiohttp.BasicAuth(
login=self.config.proxy_username,
password=self.config.proxy_password,
)
elif has_user != has_pass:
logger.warning(
"Discord proxy auth incomplete: both proxy_username and "
"proxy_password must be set; ignoring partial credentials",
)
self._client = DiscordBotClient(
self,