From 13deebab5e154247f1646302dc744bd1fa30bfb2 Mon Sep 17 00:00:00 2001 From: nin0dev Date: Mon, 12 Aug 2024 21:44:41 -0400 Subject: [PATCH] explodeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --- index.ts | 118 ------------------------------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 index.ts diff --git a/index.ts b/index.ts deleted file mode 100644 index dc9fac0..0000000 --- a/index.ts +++ /dev/null @@ -1,118 +0,0 @@ -// @ts-nocheck - -import { ProfileBadge } from "@api/Badges"; -import { Badges } from "@api/index"; -import { definePluginSettings } from "@api/Settings"; -import { Devs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; -import { Toasts, UserStore } from "@webpack/common"; -import { User } from "discord-types/general"; - -function isCurrentUser(userId: string) { - const u = UserStore.getCurrentUser().id; - return u == userId; -} - - -export default definePlugin({ - name: "ClientSideBadges", - description: "Adds client-side badges to your profile. Other users can't see them!", - authors: [Devs.nin0dev], - settings: definePluginSettings({ - discordStaff: { - type: OptionType.BOOLEAN - }, - partneredServerOwner: { - type: OptionType.BOOLEAN - }, - earlySupporter: { - type: OptionType.BOOLEAN - }, - activeDeveloper: { - type: OptionType.BOOLEAN - }, - earlyVerifiedBotDeveloper: { - type: OptionType.BOOLEAN - }, - moderatorProgramsAlumni: { - type: OptionType.BOOLEAN - }, - bugHunter: { - type: OptionType.BOOLEAN - }, - goldenBugHunter: { - type: OptionType.BOOLEAN - } - }), - async start() { - const NativeBadges: ProfileBadge[] = [ - { - description: "Discord Staff", - image: "https://cdn.discordapp.com/badge-icons/5e74e9b61934fc1f67c65515d1f7e60d.png", - position: Badges.BadgePosition.END, - shouldShow: ({ userId }) => isCurrentUser(userId) && this.settings.store.discordStaff, - link: "https://discord.com/company" - }, - { - description: "Partnered Server Owner", - image: "https://cdn.discordapp.com/badge-icons/3f9748e53446a137a052f3454e2de41e.png", - position: Badges.BadgePosition.END, - shouldShow: ({ userId }) => isCurrentUser(userId) && this.settings.store.partneredServerOwner, - link: "https://discord.com/partners" - }, - { - description: "Early Supporter", - image: "https://cdn.discordapp.com/badge-icons/7060786766c9c840eb3019e725d2b358.png", - position: Badges.BadgePosition.END, - shouldShow: ({ userId }) => isCurrentUser(userId) && this.settings.store.earlySupporter, - link: "https://discord.com/settings/premium" - }, - { - description: "Active Developer", - image: "https://cdn.discordapp.com/badge-icons/6bdc42827a38498929a4920da12695d9.png", - position: Badges.BadgePosition.END, - shouldShow: ({ userId }) => isCurrentUser(userId) && this.settings.store.activeDeveloper, - link: "https://support-dev.discord.com/hc/en-us/articles/10113997751447" - }, - { - description: "Early Verified Bot Developer", - image: "https://cdn.discordapp.com/badge-icons/6df5892e0f35b051f8b61eace34f4967.png", - position: Badges.BadgePosition.END, - shouldShow: ({ userId }) => isCurrentUser(userId) && this.settings.store.earlyVerifiedBotDeveloper, - link: "https://discord.com/settings/premium" - }, - { - description: "Moderator Programs Alumni", - image: "https://cdn.discordapp.com/badge-icons/fee1624003e2fee35cb398e125dc479b.png", - position: Badges.BadgePosition.END, - shouldShow: ({ userId }) => isCurrentUser(userId) && this.settings.store.moderatorProgramsAlumni, - link: "https://discord.com/settings/premium" - }, - { - description: "Discord Bug Hunter", - image: "https://cdn.discordapp.com/badge-icons/2717692c7dca7289b35297368a940dd0.png", - position: Badges.BadgePosition.END, - shouldShow: ({ userId }) => isCurrentUser(userId) && this.settings.store.bugHunter, - link: "https://discord.com/settings/premium" - }, - { - description: "Discord Bug Hunter", - image: "https://cdn.discordapp.com/badge-icons/848f79194d4be5ff5f81505cbd0ce1e6.png", - position: Badges.BadgePosition.END, - shouldShow: ({ userId }) => isCurrentUser(userId) && this.settings.store.goldenBugHunter, - link: "https://discord.com/settings/premium" - } - ]; - NativeBadges.forEach(b => Badges.addBadge(b)); - }, - async stop() { - Toasts.show({ - id: Toasts.genId(), - message: "To clear out your client-side badges, reload Discord.", - type: Toasts.Type.MESSAGE, - options: { - position: Toasts.Position.BOTTOM, // NOBODY LIKES TOASTS AT THE TOP - }, - }); - } -});