FakeNitro: Fix hyperlink text setting for stickers
This commit is contained in:
parent
806960f1c6
commit
553a48b6ce
1 changed files with 4 additions and 2 deletions
|
@ -162,7 +162,7 @@ const settings = definePluginSettings({
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
hyperLinkText: {
|
hyperLinkText: {
|
||||||
description: "What text the hyperlink should use. {{NAME}} will be replaced with the emoji name.",
|
description: "What text the hyperlink should use. {{NAME}} will be replaced with the emoji/sticker name.",
|
||||||
type: OptionType.STRING,
|
type: OptionType.STRING,
|
||||||
default: "{{NAME}}"
|
default: "{{NAME}}"
|
||||||
}
|
}
|
||||||
|
@ -864,7 +864,9 @@ export default definePlugin({
|
||||||
const url = new URL(link);
|
const url = new URL(link);
|
||||||
url.searchParams.set("name", sticker.name);
|
url.searchParams.set("name", sticker.name);
|
||||||
|
|
||||||
messageObj.content += `${getWordBoundary(messageObj.content, messageObj.content.length - 1)}${s.useHyperLinks ? `[${sticker.name}](${url})` : url}`;
|
const linkText = s.hyperLinkText.replaceAll("{{NAME}}", sticker.name);
|
||||||
|
|
||||||
|
messageObj.content += `${getWordBoundary(messageObj.content, messageObj.content.length - 1)}${s.useHyperLinks ? `[${linkText}](${url})` : url}`;
|
||||||
extra.stickers!.length = 0;
|
extra.stickers!.length = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue