feat(plugin): PinIcon (#53)

* adding PinIcon

* patch change

* include dev to constants

* include dev to authors

* mb

* moved PinIcon to correct location
This commit is contained in:
programminglaboratorys 2024-10-15 02:38:06 +03:00 committed by GitHub
parent 9dd8a65eb2
commit da8eeed5cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,40 @@
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2022 Vendicated and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
import { Icons } from "@webpack/common";
import { Message } from "discord-types/general";
export default definePlugin({
name: "PinIcon",
description: "Adds a pin icon to pinned messages",
authors: [EquicordDevs.iamme],
patches: [
{
find: ".Messages.MESSAGE_EDITED,",
replacement: {
match: /(children:\[null!=\i.+?(?:[^}]*[}]){3}\))/,
replace: "$1,$self.PinnedIcon(arguments[0].message)"
}
}
],
PinnedIcon({ pinned }: Message) {
return pinned ? <Icons.PinIcon size="xs" style={{ marginLeft: "5px" }} /> : null;
}
});

View file

@ -913,6 +913,10 @@ export const EquicordDevs = Object.freeze({
name: "arHSM",
id: 841509053422632990n
},
iamme: {
name: "i am me",
id: 984392761929256980n
},
creations: {
name: "Creation's",
id: 209830981060788225n