mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 14:13:01 -04:00
Added toggles for Sticker links / emoji links (#234)
Some checks are pending
Test / Test (push) Waiting to run
Some checks are pending
Test / Test (push) Waiting to run
* Added toggles for Sticker links / emoji links * Redo Setting Names --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com>
This commit is contained in:
parent
e620e46ebe
commit
179b56e57f
1 changed files with 10 additions and 5 deletions
|
@ -167,8 +167,13 @@ const settings = definePluginSettings({
|
|||
default: true,
|
||||
restartNeeded: true
|
||||
},
|
||||
useHyperLinks: {
|
||||
description: "Whether to use hyperlinks when sending fake emojis and stickers",
|
||||
useStickerHyperLinks: {
|
||||
description: "Whether to use hyperlinks when sending fake stickers",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: true
|
||||
},
|
||||
useEmojiHyperLinks: {
|
||||
description: "Whether to use hyperlinks when sending fake emojis",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: true
|
||||
},
|
||||
|
@ -910,7 +915,7 @@ export default definePlugin({
|
|||
|
||||
const linkText = s.hyperLinkText.replaceAll("{{NAME}}", sticker.name);
|
||||
|
||||
messageObj.content += `${getWordBoundary(messageObj.content, messageObj.content.length - 1)}${s.useHyperLinks ? `[${linkText}](${url})` : url}`;
|
||||
messageObj.content += `${getWordBoundary(messageObj.content, messageObj.content.length - 1)}${s.useStickerHyperLinks ? `[${linkText}](${url})` : url}`;
|
||||
extra.stickers!.length = 0;
|
||||
}
|
||||
}
|
||||
|
@ -933,7 +938,7 @@ export default definePlugin({
|
|||
const linkText = s.hyperLinkText.replaceAll("{{NAME}}", emoji.name);
|
||||
|
||||
messageObj.content = messageObj.content.replace(emojiString, (match, offset, origStr) => {
|
||||
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[${linkText}](${url})` : url}${getWordBoundary(origStr, offset + match.length)}`;
|
||||
return `${getWordBoundary(origStr, offset - 1)}${s.useEmojiHyperLinks ? `[${linkText}](${url})` : url}${getWordBoundary(origStr, offset + match.length)}`;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -965,7 +970,7 @@ export default definePlugin({
|
|||
|
||||
const linkText = s.hyperLinkText.replaceAll("{{NAME}}", emoji.name);
|
||||
|
||||
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[${linkText}](${url})` : url}${getWordBoundary(origStr, offset + emojiStr.length)}`;
|
||||
return `${getWordBoundary(origStr, offset - 1)}${s.useEmojiHyperLinks ? `[${linkText}](${url})` : url}${getWordBoundary(origStr, offset + emojiStr.length)}`;
|
||||
});
|
||||
|
||||
if (hasBypass && !s.disableEmbedPermissionCheck && !hasEmbedPerms(channelId)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue