Compare commits
2 commits
89ee3fba97
...
675cabb310
Author | SHA1 | Date | |
---|---|---|---|
675cabb310 | |||
2ddf4753c1 |
1 changed files with 30 additions and 4 deletions
34
index.ts
34
index.ts
|
@ -13,8 +13,8 @@ import { GuildMemberStore, UserStore } from "@webpack/common";
|
|||
|
||||
import plugins, { PluginMeta } from "~plugins";
|
||||
|
||||
import SettingsPlugin from "../../plugins/_core/settings";
|
||||
import { isPluginDev } from "@utils/misc";
|
||||
import SettingsPlugin from "../../plugins/_core/settings";
|
||||
|
||||
const clientVersion = () => {
|
||||
const version = IS_DISCORD_DESKTOP ? DiscordNative.app.getVersion() : IS_VESKTOP ? VesktopNative.app.getVersion() : null;
|
||||
|
@ -80,7 +80,7 @@ function getEnabledPlugins() {
|
|||
};
|
||||
});
|
||||
|
||||
return `${counter}/${total} (official)` + (totalUserplugins ? `, ${userpluginsCount}/${totalUserplugins} (userplugins)` : "");
|
||||
return `${counter} / ${total} (official)` + (totalUserplugins ? `, ${userpluginsCount} / ${totalUserplugins} (userplugins)` : "");
|
||||
}
|
||||
function getDonorStatus() {
|
||||
return GuildMemberStore.getMember("1015060230222131221", UserStore.getCurrentUser().id).roles.includes("1042507929485586532");
|
||||
|
@ -112,10 +112,34 @@ function humanFileSize(bytes, si = false, dp = 1) {
|
|||
return bytes.toFixed(dp) + " " + units[u];
|
||||
}
|
||||
|
||||
let BUILD_NUMBER;
|
||||
let VERSION_HASH;
|
||||
|
||||
export default definePlugin({
|
||||
name: "venfetch",
|
||||
description: "neofetch for vencord",
|
||||
authors: [Devs.nin0dev],
|
||||
patches: [
|
||||
{
|
||||
find: /.log\("[BUILD INFO]/,
|
||||
replacement: [
|
||||
{
|
||||
match: /Build Number: "\).concat\(("\d+")/,
|
||||
replace: "Build Number: \").concat($self.setBuildNumber($1)"
|
||||
},
|
||||
{
|
||||
match: /Version Hash: \"\).concat\(("\w+")/,
|
||||
replace: "Version Hash: \").concat($self.setVersionHash($1)"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
setBuildNumber(buildNumber) {
|
||||
return BUILD_NUMBER = buildNumber;
|
||||
},
|
||||
setVersionHash(versionHash) {
|
||||
return VERSION_HASH = versionHash;
|
||||
},
|
||||
commands: [
|
||||
{
|
||||
name: "venfetch",
|
||||
|
@ -126,8 +150,10 @@ export default definePlugin({
|
|||
const info: Record<string, string | null> = {
|
||||
version: `${VERSION} ~ ${gitHash}${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat(navigator.language, { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`,
|
||||
client: `${t(window.GLOBAL_ENV.RELEASE_CHANNEL)} ~ ${clientVersion()}`,
|
||||
// TODO: fix this
|
||||
// build: `${BUILD_NUMBER ?? "Unknown"} (${VERSION_HASH?.slice(0, 7) ?? 'unknown'})`,
|
||||
// @ts-ignore
|
||||
platform: navigator.userAgentData?.platform ?? navigator.platform,
|
||||
platform: navigator.userAgentData?.platform ? `${navigator.userAgentData?.platform} (${navigator.platform})` : navigator.platform,
|
||||
plugins: getEnabledPlugins(),
|
||||
uptime: `${~~((Date.now() - window.GLOBAL_ENV.HTML_TIMESTAMP) / 1000)}s`,
|
||||
// TODO: pr to vencord real and add to vencordnative
|
||||
|
@ -135,7 +161,7 @@ export default definePlugin({
|
|||
_: null,
|
||||
|
||||
donor: getDonorStatus() ? "yes" : "no",
|
||||
contributor: getContribStatus() ? "yes" : null,
|
||||
contributor: getContribStatus() ? "yes" : "no",
|
||||
|
||||
__: null,
|
||||
|
||||
|
|
Loading…
Reference in a new issue