Skip to content

feat(server): replace bot with webhook for portal channel messages#189

Merged
skyhancloud merged 5 commits intomainfrom
patch
Jun 16, 2025
Merged

feat(server): replace bot with webhook for portal channel messages#189
skyhancloud merged 5 commits intomainfrom
patch

Conversation

@skyhancloud
Copy link
Member

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.

@skyhancloud skyhancloud requested a review from Copilot June 16, 2025 01:10
@skyhancloud skyhancloud self-assigned this Jun 16, 2025
@skyhancloud skyhancloud added the Backend: Feature Requests or discussions related to new features in the Express backend. label Jun 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sendPortalMessage utility
  • Replaced client.channels.cache.get(config.portalChannelId).send(...) calls with sendPortalMessage(...) across multiple routes
  • Removed old portalChannelId config, added DISCORD_PORTAL_CHANNEL_WEBHOOK_URL in 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 logger object 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>
@skyhancloud skyhancloud merged commit 95c8782 into main Jun 16, 2025
4 checks passed
@skyhancloud skyhancloud deleted the patch branch June 16, 2025 01:13
@github-actions github-actions bot mentioned this pull request Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend: Feature Requests or discussions related to new features in the Express backend.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants