mirror of https://github.com/vizality/vizality
Idk, last salvage remains from recovery
parent
f8005c3418
commit
68bf68737f
@ -0,0 +1,38 @@
|
||||
const { react: { forceUpdateElement } } = require('@vizality/util');
|
||||
const { patch, unpatch } = require('@vizality/patcher');
|
||||
const { getModule } = require('@vizality/webpack');
|
||||
const { React } = require('@vizality/react');
|
||||
|
||||
module.exports = () => {
|
||||
const ApplicationCommandDiscoverySectionList = getModule(m => m.default?.displayName === 'ApplicationCommandDiscoverySectionList');
|
||||
const { rail } = getModule('rail');
|
||||
|
||||
patch('vz-attributes-assd', ApplicationCommandDiscoverySectionList, 'default', (args) => {
|
||||
args[0].sections[args[0].sections.length] = {
|
||||
icon: 'vz-plugin://better-code-blocks/assets/icon.png',
|
||||
id: 'better-code-blocks',
|
||||
isBuiltIn: false,
|
||||
name: 'Better Code Blocks'
|
||||
};
|
||||
|
||||
args[0].sections[args[0].sections.length] = {
|
||||
icon: 'vz-plugin://vz-spotify/assets/icon.png',
|
||||
id: 'spotify-in-discord',
|
||||
isBuiltIn: false,
|
||||
name: 'Spotify in Discord'
|
||||
};
|
||||
|
||||
args[0].sections[args[0].sections.length] = {
|
||||
icon: 'https://cdn.vizality.com/assets/logo.png',
|
||||
id: 'vizality',
|
||||
isBuiltIn: false,
|
||||
name: 'Vizality'
|
||||
};
|
||||
|
||||
return args;
|
||||
}, true);
|
||||
|
||||
setImmediate(() => forceUpdateElement(`.${rail}`));
|
||||
|
||||
return () => unpatch('vz-attributes-assd');
|
||||
};
|
@ -0,0 +1,28 @@
|
||||
const { react: { forceUpdateElement, findInReactTree } } = require('@vizality/util');
|
||||
const { patch, unpatch } = require('@vizality/patcher');
|
||||
const { getModule } = require('@vizality/webpack');
|
||||
const { React } = require('@vizality/react');
|
||||
|
||||
module.exports = () => {
|
||||
const ApplicationCommandDiscoveryApplicationIcon = getModule(m => m.default?.displayName === 'ApplicationCommandDiscoveryApplicationIcon');
|
||||
const { mask, icon } = getModule('mask', 'icon');
|
||||
|
||||
patch('vz-attributes-sacvx', ApplicationCommandDiscoveryApplicationIcon, 'default', (args, res) => {
|
||||
let { src } = findInReactTree(res, r => r.src);
|
||||
|
||||
if (src.includes('vz-plugin://') || src.includes('https://cdn.vizality.com/assets/logo.png')) {
|
||||
src = src.split('.webp');
|
||||
if (new RegExp(`https://cdn.discordapp.com/app-icons/(.*)/`).test(src[0])) {
|
||||
res.props.children.props.children.props.src = src[0].replace(new RegExp(`https://cdn.discordapp.com/app-icons/([^/]+)/`, 'ig'), '');
|
||||
console.log(res.props.children.props.children.props.src);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
});
|
||||
|
||||
// setImmediate(() => forceUpdateElement(`.${mask}`));
|
||||
// setImmediate(() => forceUpdateElement(`.${icon}`));
|
||||
|
||||
return () => unpatch('vz-attributes-sacvx');
|
||||
};
|
Loading…
Reference in new issue