mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-31 03:33:36 -05:00
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:
parent
9dd8a65eb2
commit
da8eeed5cb
2 changed files with 44 additions and 0 deletions
40
src/equicordplugins/pinIcon/index.tsx
Normal file
40
src/equicordplugins/pinIcon/index.tsx
Normal 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;
|
||||
}
|
||||
});
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue