worked on premium
diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index 1c9db24..9d2c2b1 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -25,23 +25,23 @@
], components: [new ActionRowBuilder<ButtonBuilder>().addComponents(new ButtonBuilder().setStyle(ButtonStyle.Link).setLabel("Join").setURL("https://discord.gg/bPaNnxe"))] });
return;
}
- const dbMember = await client.database.premium.fetchTotal(interaction.user.id)
- let premium;
+ const dbMember = await client.database.premium.fetchUser(interaction.user.id)
+ let premium = `You do not have premium! You can't activate premium on any servers.`;
let count = 0;
- if (member.roles.cache.has("1066468879309750313")) {
+ const {level, appliesTo} = dbMember || {level: 0, appliesTo: []}
+ if (level === 99) {
premium = `You have Infinite Premium! You have been gifted this by the developers as a thank you. You can give premium to any and all servers you are in.`;
count = 200;
- } else if (member.roles.cache.has("1066465491713003520")) {
- premium = `You have Premium tier 1! You can give premium to ${1 - dbMember}.`;
+ } else if (level === 1) {
+ premium = `You have Premium tier 1! You can give premium to ${1 - appliesTo.length} more servers.`;
count = 1;
- } else if (member.roles.cache.has("1066439526496604194")) {
- premium = `You have Premium tier 2! You can give premium to ${3 - dbMember}.`;
+ } else if (level === 2) {
+ premium = `You have Premium tier 2! You can give premium to ${3 - appliesTo.length} more servers.`;
count = 3;
- } else if (member.roles.cache.has("1066464134322978912")) {
- premium = `You have Premium Mod! You already give premium to all servers you have a "manage" permission in.`
+ } else if (level === 3) {
+ premium = `You have Premium Mod! You can give premium to ${3 - appliesTo.length} more servers, as well as automatically giving premium to all servers you have a "manage" permission in.`
count = 3;
}
-
const hasPremium = await client.database.premium.hasPremium(interaction.guild!.id);
let premiumGuild = ""
if (hasPremium) {
@@ -82,8 +82,7 @@
if (i) {
i.deferUpdate();
let guild = i.guild!;
- let m = await client.database.premium.fetchTotal(interaction.user.id);
- if (count - m <= 0) {
+ if (count - appliesTo.length <= 0) {
interaction.editReply({
embeds: [
new EmojiEmbed()