feat(server): replace bot with webhook for portal channel messages#189
Merged
skyhancloud merged 5 commits intomainfrom Jun 16, 2025
Merged
feat(server): replace bot with webhook for portal channel messages#189skyhancloud merged 5 commits intomainfrom
skyhancloud merged 5 commits intomainfrom
Conversation
…AL_CHANNEL_WEBHOOK_URL webhook
… in multiple routes
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces direct Discord channel sends with a webhook-based utility for portal messages, updates configuration to use a webhook URL, and refreshes docs and env examples accordingly.
- Introduced
sendPortalMessageutility - Replaced
client.channels.cache.get(config.portalChannelId).send(...)calls withsendPortalMessage(...)across multiple routes - Removed old
portalChannelIdconfig, addedDISCORD_PORTAL_CHANNEL_WEBHOOK_URLin env/example and README
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/src/utils/sendPortalMessage.js | New webhook utility for sending portal channel messages |
| server/src/routes/** | Replaced direct sends with sendPortalMessage in all routes |
| server/config.yml | Removed portalChannelId entry |
| server/.example.env | Added DISCORD_PORTAL_CHANNEL_WEBHOOK_URL |
| README.md | Documented new webhook env var usage |
Comments suppressed due to low confidence (2)
server/src/utils/sendPortalMessage.js:1
- There are no unit tests covering this new utility; add tests to verify successful sends and error handling paths.
const Discord = require('discord.js');
server/src/utils/sendPortalMessage.js:13
- The
loggerobject is not defined in this file, leading to a ReferenceError on failures. Import or pass in a logger instance before using it.
logger.error('There was an error while sending a message to the portal channel webhook:');
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new utility function,
sendPortalMessage, to streamline sending messages to the Discord portal channel via webhooks. It also updates the configuration to replace direct channel ID usage with a webhook URL. Documentation and environment configuration files are updated accordingly.