Skip to content

Commit

Permalink
feat: vip command
Browse files Browse the repository at this point in the history
  • Loading branch information
Skillz4Killz committed May 15, 2023
1 parent bbe6756 commit cfcf83e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/commands/settings/vip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Command, PermissionLevels } from "../../base/typings.js";
import { prisma } from "../../prisma/client.js";

export const vip: Command = {
name: "vip",
aliases: [],
arguments: [],
requiredPermissionLevel: PermissionLevels.Admin,
execute: async function (message) {
// ONLY GUILDS CAN BE VIP
if (!message.guildId) return;

await message.reply(message.translate("VIP_SUCCESS"), { addReplay: false });

// UPDATE TABLE
return await Promise.all([
prisma.vipGuilds.upsert({
where: { guildId: message.guildId },
create: {
guildId: message.guildId,
isVip: true,
userId: message.author.id,
},
update: {
isVip: true,
userId: message.author.id,
},
}),
prisma.vipUsers.upsert({
where: { userId: message.author.id },
create: {
guildIds: [message.guildId],
isVip: true,
userId: message.author.id,
},
update: {
guildIds: { push: message.guildId },
},
}),
]);
},
};

0 comments on commit cfcf83e

Please sign in to comment.