Add discord webhook support
Description
Adds Discord webhook support to py-clash-bot, allowing users to receive real-time notifications about bot activity directly in Discord.
Changes Made
- Added
DiscordWebhookutility class for sending notifications - Integrated webhook notifications into logger for key events:
- Bot started/stopped
- Battle wins/losses
- Error notifications
- Added Discord webhook URL field to UI (Misc tab)
- Updated dependencies to include
requestspackage - Added comprehensive documentation in README.md
Features
- Real-time Discord notifications for bot events
- Optional feature (can be disabled by leaving field empty)
- Non-blocking async notifications
- Graceful error handling (bot continues if webhook fails)
- Privacy-focused (webhook URLs stored locally only)
Testing
- [x] Tested Discord webhook notifications work correctly
- [x] Verified bot continues operating if webhook fails
- [x] Confirmed webhook URL is saved and persists between sessions
- [x] Tested all notification types (start, stop, wins, losses, errors)
Documentation
- [x] Updated README.md with setup instructions
- [x] Added examples and usage notes
- [x] Code includes comprehensive docstrings
I liked this when it was 400 lines. It crept out of scope and is now squeezing in features unrelated to discord webhooks. I would prefer if it were broken up, one PR per feature.
Yes it was a full mistake I pushed to the same branch on accident I'm not at my computer rn so I can't change anything tonight but will within a day
I was planning on making a new pull for deck to send the deck stuff to a website and have that in the background for more deck images