Add Discord webhook adapter#196
Merged
orangecoding merged 5 commits intoorangecoding:masterfrom Sep 27, 2025
maribowman:feature/initial-discord-adapter
Merged
Add Discord webhook adapter#196orangecoding merged 5 commits intoorangecoding:masterfrom maribowman:feature/initial-discord-adapter
orangecoding merged 5 commits intoorangecoding:masterfrom
maribowman:feature/initial-discord-adapter
Conversation
orangecoding
requested changes
Sep 27, 2025
| const fields = [ | ||
| { | ||
| name: 'Price', | ||
| value: listing.price, |
Owner
There was a problem hiding this comment.
if for some reasons the values ever be null, discord will start spitting fire. We can make this safe by doing something like this:
String(listing.price ?? 'n/a')
orangecoding
requested changes
Sep 27, 2025
| */ | ||
| const buildEmbed = (jobKey, listing) => { | ||
| const maxTitleLength = 252; // Max embed title length is 256 characters | ||
| let title = listing.title; |
Owner
There was a problem hiding this comment.
In all your calls you're assuming that the values are actually there. That is however not for granted. E.g. listing.title can be null if some page changed their structure. This would lead to nullpointers in here,.
use this please:
let title = listing.title || 'N/A';
| }, | ||
| { | ||
| name: 'Size', | ||
| value: listing.size.replace(/2m/g, 'm²'), |
Owner
There was a problem hiding this comment.
also size can be null..
listing?.size?.replace(/2m/g, 'm²') ?? 'N/A'
Owner
|
Thanks! |
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.
*Discord only allows up to 10 embeds per message