balls gaming
This commit is contained in:
parent
08491081e5
commit
53d85bc53e
1 changed files with 21 additions and 9 deletions
30
index.ts
30
index.ts
|
@ -11,6 +11,8 @@ import { sendMessage } from "@utils/discord";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { GuildMemberStore, UserStore } from "@webpack/common";
|
import { GuildMemberStore, UserStore } from "@webpack/common";
|
||||||
|
|
||||||
|
import plugins, { PluginMeta } from "~plugins";
|
||||||
|
|
||||||
import SettingsPlugin from "../../plugins/_core/settings";
|
import SettingsPlugin from "../../plugins/_core/settings";
|
||||||
|
|
||||||
const client = (() => {
|
const client = (() => {
|
||||||
|
@ -22,7 +24,7 @@ const client = (() => {
|
||||||
const name = typeof unsafeWindow !== "undefined" ? "UserScript" : "Web";
|
const name = typeof unsafeWindow !== "undefined" ? "UserScript" : "Web";
|
||||||
return `${name} (${navigator.userAgent})`;
|
return `${name} (${navigator.userAgent})`;
|
||||||
})();
|
})();
|
||||||
let uptime = 0;
|
const launchTime = Date.now();
|
||||||
|
|
||||||
const line1 = "```ansi";
|
const line1 = "```ansi";
|
||||||
// Placeholders: %username%
|
// Placeholders: %username%
|
||||||
|
@ -54,16 +56,25 @@ function getEnabledPlugins() {
|
||||||
function getDonorStatus() {
|
function getDonorStatus() {
|
||||||
return GuildMemberStore.getMember("1015060230222131221", UserStore.getCurrentUser().id).roles.includes("1042507929485586532");
|
return GuildMemberStore.getMember("1015060230222131221", UserStore.getCurrentUser().id).roles.includes("1042507929485586532");
|
||||||
}
|
}
|
||||||
|
function getPluginCount() {
|
||||||
|
const isApiPlugin = (plugin: string) => plugin.endsWith("API") || plugins[plugin].required;
|
||||||
|
|
||||||
|
const enabledPlugins = Object.keys(plugins)
|
||||||
|
.filter(p => Vencord.Plugins.isPluginEnabled(p) && !isApiPlugin(p));
|
||||||
|
|
||||||
|
const enabledStockPlugins = enabledPlugins.filter(p => !PluginMeta[p].userPlugin);
|
||||||
|
const enabledUserPlugins = enabledPlugins.filter(p => PluginMeta[p].userPlugin);
|
||||||
|
|
||||||
|
return {
|
||||||
|
stock: enabledStockPlugins.length,
|
||||||
|
user: enabledUserPlugins.length
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "venfetch",
|
name: "venfetch",
|
||||||
description: "neofetch for vencord",
|
description: "neofetch for vencord",
|
||||||
authors: [Devs.nin0dev],
|
authors: [Devs.nin0dev],
|
||||||
start() {
|
|
||||||
setInterval(() => {
|
|
||||||
uptime++;
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
commands: [
|
commands: [
|
||||||
{
|
{
|
||||||
name: "venfetch",
|
name: "venfetch",
|
||||||
|
@ -78,15 +89,16 @@ export default definePlugin({
|
||||||
Client: `${window.GLOBAL_ENV.RELEASE_CHANNEL} ~ ${client}`,
|
Client: `${window.GLOBAL_ENV.RELEASE_CHANNEL} ~ ${client}`,
|
||||||
Platform: window.navigator.platform
|
Platform: window.navigator.platform
|
||||||
};
|
};
|
||||||
|
const pluggers = getPluginCount();
|
||||||
sendMessage(ctx.channel.id, {
|
sendMessage(ctx.channel.id, {
|
||||||
content: `${line1}
|
content: `${line1}
|
||||||
${line2.replace("%username%", username)}
|
${line2.replace("%username%", username)}
|
||||||
${line3}\n${line4.replace("%ver%", info.Vencord)}
|
${line3}\n${line4.replace("%ver%", info.Vencord)}
|
||||||
${line5.replace("%client%", info.Client)}
|
${line5.replace("%client%", info.Client)}
|
||||||
${line6.replace("%platform%", info.Platform)}
|
${line6.replace("%platform%", info.Platform)}
|
||||||
${line7.replace("%pluginCount%", getEnabledPlugins())}
|
${line7.replace("%pluginCount%", `${pluggers.stock} official, ${pluggers.user} userplugins`)}
|
||||||
${line8.replace("%uptime%", `${uptime}s`)}
|
${line8.replace("%uptime%", `${Math.floor((Date.now() - launchTime) / 1000)}s`)}
|
||||||
${line9.replace("%donorStatus%", getDonorStatus() ? "yes" : "no")}
|
${line9.replace("%donorStatus%", getDonorStatus() ? "yop" : "nop")}
|
||||||
${line10}
|
${line10}
|
||||||
${line11}
|
${line11}
|
||||||
${line12}`
|
${line12}`
|
||||||
|
|
Loading…
Reference in a new issue