Plugin
NoNitroUpsell
Removes ALL of Discord's nitro upsells by tricking the client into thinking you have nitro.
1
/*2
* FiveCord — a Discord client mod3
* Copyright (c) 2025 FiveCord4
* SPDX-License-Identifier: GPL-3.0-or-later5
*/6
7
import { Devs } from "@utils/constants";8
import definePlugin from "@utils/types";9
import { UserStore } from "@webpack/common";10
import { User } from "discord-types/general";11
12
let user: ModifiedUser | undefined;13
let lastUserId: string | undefined;14
let uninject: (() => void) | undefined;15
16
interface ModifiedUser extends User {17
_realPremiumType?: number;18
}19
20
export default definePlugin({21
name: "NoNitroUpsell",22
description: "Removes ALL of Discord039;s nitro upsells by tricking the client into thinking you have nitro.",23
authors: [Devs.FiveCord],24
ready(user: ModifiedUser): void {25
if (!user) return;26
if ("_realPremiumType" in user) return;27
28
user._realPremiumType = user.premiumType ?? 0;29
user.premiumType = 2;30
lastUserId = user.id;31
},32
start(): void {33
user = UserStore.getCurrentUser();34
if (user) this.ready(user);35
36
const onChange = (): void => {37
const newUser = UserStore.getCurrentUser();38
if (newUser && newUser.id !== lastUserId) {39
user = newUser;40
this.ready(user);41
}42
};43
44
UserStore.addChangeListener(onChange);45
uninject = () => UserStore.removeChangeListener(onChange);46
},47
stop(): void {48
uninject?.();49
const user = UserStore.getCurrentUser();50
if (!user) return;51
if (!("_realPremiumType" in user)) return;52
UserStore?.getCurrentUser()?.premiumType;53
// @ts-ignore54
user.premiumType = user._realPremiumType;55
delete user._realPremiumType;56
}57
});58