mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-20 06:30:35 +00:00
fix var names, regex, and types
This commit is contained in:
parent
8e649cfcc4
commit
bdae37ff23
1 changed files with 13 additions and 13 deletions
|
@ -360,19 +360,19 @@ const expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { t
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function imageContextPatch(c, p: {
|
const imageContextPatch: NavContextMenuPatchCallback = (children, props: {
|
||||||
src: string
|
src: string
|
||||||
}){
|
}) => {
|
||||||
if ("src" in p && /https:\/\/cdn\.discordapp\.com\/emojis\/(\d+)\.[a-zA-Z]{3,4}.*/gm.test(p.src)) {
|
if ("src" in props && /https:\/\/cdn\.discordapp\.com\/emojis\/(\d+)\.([a-zA-Z]{3,4}).*/gm.test(props.src)) {
|
||||||
const matches = [...p.src.matchAll(/https:\/\/cdn\.discordapp\.com\/emojis\/(\d+)\.[a-zA-Z]{3,4}.*/gm)];
|
const matches = [...props.src.matchAll(/https:\/\/cdn\.discordapp\.com\/emojis\/(\d+)\.([a-zA-Z]{3,4}).*/gm)];
|
||||||
if (!matches) return;
|
if (!matches) return;
|
||||||
c.push(buildMenuItem("Emoji", () => ({
|
children.push(buildMenuItem("Emoji", () => ({
|
||||||
id: matches[0][1],
|
id: matches[0][1],
|
||||||
isAnimated: (matches[0][2] === "gif"),
|
isAnimated: (matches[0][2] === "gif"),
|
||||||
name: "ProfileEmoji"
|
name: "ProfileEmoji"
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
interface HangStatus {
|
interface HangStatus {
|
||||||
emoji?: {
|
emoji?: {
|
||||||
// used for unicode emojis and custom emojis
|
// used for unicode emojis and custom emojis
|
||||||
|
@ -382,19 +382,19 @@ interface HangStatus {
|
||||||
animated?: boolean
|
animated?: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function vcHangStatusContextPatch(c, p: {
|
const vcHangStatusContextPatch: NavContextMenuPatchCallback =(children, props: {
|
||||||
user: {
|
user: {
|
||||||
HangStatus?: HangStatus
|
HangStatus?: HangStatus
|
||||||
}
|
}
|
||||||
}){
|
}) => {
|
||||||
if(p.user.HangStatus?.emoji?.id){
|
if(props.user.HangStatus?.emoji?.id){
|
||||||
const e = p.user.HangStatus.emoji as Emoji;
|
const e = props.user.HangStatus.emoji as Emoji;
|
||||||
e.isAnimated = p.user.HangStatus.emoji.animated ?? false;
|
e.isAnimated = props.user.HangStatus.emoji.animated ?? false;
|
||||||
c.push(buildMenuItem("Emoji", () => {
|
children.push(buildMenuItem("Emoji", () => {
|
||||||
return e;
|
return e;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "EmoteCloner",
|
name: "EmoteCloner",
|
||||||
description: "Allows you to clone Emotes & Stickers to your own server (right click them)",
|
description: "Allows you to clone Emotes & Stickers to your own server (right click them)",
|
||||||
|
|
Loading…
Reference in a new issue