Skip to content

Commit

Permalink
Super quick patch for Attachment Links!
Browse files Browse the repository at this point in the history
  • Loading branch information
TwilightZebby committed Aug 23, 2024
1 parent a16299b commit a42ff7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions BotModules/Events/MessageEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,9 @@ module.exports = {

if ( RepliedMessage.poll == null )
{
// Use CDN link for first Attachment if no content is included but there is an Attachment
crosspostMessage = `${RepliedMessage.content.length > 0 ?
`${RepliedMessage.content.length > 1990 ? `${RepliedMessage.content.slice(0, 1991)}...` : RepliedMessage.content}`
: RepliedMessage.attachments.size > 0 ? `${RepliedMessage.attachments.first()?.url}` : ''}`;
: containsUnsupportedAttachments ? `${RepliedMessage.attachments.first()?.url}` : ''}`;

// Button Label depends on Attachments (if any)
if ( RepliedMessage.content !== '' && originalAttachments.length === 0 && containsUnsupportedAttachments ) { ButtonMessageLink.setLabel(localize(message.guild.preferredLocale, 'HOME_ORIGINAL_MESSAGE_AND_ATTACHMENT_TAG')); }
Expand Down Expand Up @@ -429,7 +428,7 @@ module.exports = {
// Use CDN link for first Attachment if no content is included but there is an Attachment
crosspostMessage = `${message.content.length > 0 ?
`${message.content.length > 1990 ? `${message.content.slice(0, 1991)}...` : message.content}`
: message.attachments.size > 0 ? `${message.attachments.first()?.url}` : ''}`;
: containsUnsupportedAttachments ? `${message.attachments.first()?.url}` : ''}`;

// Button Label depends on Attachments (if any)
if ( message.content !== '' && originalAttachments.length === 0 && containsUnsupportedAttachments ) { ButtonMessageLink.setLabel(localize(message.guild.preferredLocale, 'HOME_ORIGINAL_MESSAGE_AND_ATTACHMENT_TAG')); }
Expand Down
2 changes: 1 addition & 1 deletion Interactions/Selects/Home/feature-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = {
// Use CDN link for first Attachment if no content is included but there is an Attachment
crosspostMessage = `${OriginalMessage.content.length > 0 ?
`${OriginalMessage.content.length > 1990 ? `${OriginalMessage.content.slice(0, 1991)}...` : OriginalMessage.content}`
: OriginalMessage.attachments.size > 0 ? `${OriginalMessage.attachments.first()?.url}` : ''}`;
: containsUnsupportedAttachments ? `${OriginalMessage.attachments.first()?.url}` : ''}`;

// Button Label depends on Attachments (if any)
if ( OriginalMessage.content !== '' && originalAttachments.length === 0 && containsUnsupportedAttachments ) { ButtonMessageLink.setLabel(localize(OriginalMessage.guild.preferredLocale, 'HOME_ORIGINAL_MESSAGE_AND_ATTACHMENT_TAG')); }
Expand Down

0 comments on commit a42ff7e

Please sign in to comment.