From ca91ef4e39cb338200b553eeab905f3f04537940 Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Sat, 15 Apr 2023 08:31:36 +0800 Subject: [PATCH] feat(moreUserTags): add HTML data attributes to user tags (#883) Co-authored-by: V --- src/plugins/moreUserTags.ts | 7 ++++++- src/utils/constants.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/plugins/moreUserTags.ts b/src/plugins/moreUserTags.ts index e45e30a4..3fa0aa1b 100644 --- a/src/plugins/moreUserTags.ts +++ b/src/plugins/moreUserTags.ts @@ -118,7 +118,7 @@ const settings = definePluginSettings({ export default definePlugin({ name: "MoreUserTags", description: "Adds tags for webhooks and moderative roles (owner, admin, etc.)", - authors: [Devs.Cyn, Devs.TheSun], + authors: [Devs.Cyn, Devs.TheSun, Devs.RyanCaoDev], settings, patches: [ // add tags to the tag list @@ -140,6 +140,11 @@ export default definePlugin({ { match: /(\i)=(\i)===\i\.ORIGINAL_POSTER/, replace: "$1=$self.isOPTag($2)" + }, + // add HTML data attributes (for easier theming) + { + match: /children:\[(?=\i,\(0,\i\.jsx\)\("span",{className:\i\(\)\.botText,children:(\i)}\)\])/, + replace: "'data-tag':$1.toLowerCase(),children:[" } ], }, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 99da615f..6a939c94 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -258,8 +258,12 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "pylix", id: 492949202121261067n }, + RyanCaoDev: { + name: "RyanCaoDev", + id: 952235800110694471n, + }, Strencher: { name: "Strencher", id: 415849376598982656n - } + }, });