🚨 Fixed some JS-0116
This commit is contained in:
parent
89b67906ec
commit
3e5cbeb237
18 changed files with 18 additions and 21 deletions
|
@ -33,7 +33,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { guild, options } = interaction;
|
const { guild, options } = interaction;
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
|
|
|
@ -42,7 +42,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -63,7 +63,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -48,7 +48,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { guild } = interaction;
|
const { guild } = interaction;
|
||||||
if (!guild) throw new Error("Guild not found");
|
if (!guild) throw new Error("Guild not found");
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -54,7 +54,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -41,7 +41,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -30,7 +30,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -47,7 +47,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { errorColor, successColor, footerText, footerIcon } =
|
const { errorColor, successColor, footerText, footerIcon } =
|
||||||
await getEmbedConfig(interaction.guild);
|
await getEmbedConfig(interaction.guild);
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { errorColor, successColor, footerText, footerIcon } =
|
const { errorColor, successColor, footerText, footerIcon } =
|
||||||
await getEmbedConfig(interaction.guild); // Destructure
|
await getEmbedConfig(interaction.guild); // Destructure
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, true);
|
await deferReply(interaction, true);
|
||||||
|
|
||||||
await checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
checkPermission(interaction, PermissionsBitField.Flags.ManageGuild);
|
||||||
|
|
||||||
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
const { successColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -30,10 +30,7 @@ export default {
|
||||||
execute: async (interaction: ChatInputCommandInteraction) => {
|
execute: async (interaction: ChatInputCommandInteraction) => {
|
||||||
await deferReply(interaction, false);
|
await deferReply(interaction, false);
|
||||||
|
|
||||||
await checkPermission(
|
checkPermission(interaction, PermissionsBitField.Flags.ManageMessages);
|
||||||
interaction,
|
|
||||||
PermissionsBitField.Flags.ManageMessages
|
|
||||||
);
|
|
||||||
|
|
||||||
const { errorColor, footerText, footerIcon } = await getEmbedConfig(
|
const { errorColor, footerText, footerIcon } = await getEmbedConfig(
|
||||||
interaction.guild
|
interaction.guild
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { BaseInteraction, PermissionResolvable } from "discord.js";
|
import { BaseInteraction, PermissionResolvable } from "discord.js";
|
||||||
|
|
||||||
export default async (
|
export default (
|
||||||
interaction: BaseInteraction,
|
interaction: BaseInteraction,
|
||||||
permission: PermissionResolvable
|
permission: PermissionResolvable
|
||||||
) => {
|
) => {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import logger from "../../../../../middlewares/logger";
|
||||||
|
|
||||||
import { GuildShopRoles } from "@prisma/client";
|
import { GuildShopRoles } from "@prisma/client";
|
||||||
|
|
||||||
export const execute = async (_client: Client, role: GuildShopRoles) => {
|
export const execute = (_client: Client, role: GuildShopRoles) => {
|
||||||
const { roleId } = role;
|
const { roleId } = role;
|
||||||
|
|
||||||
logger.silly(`Shop role ${roleId} is not due for payment.`);
|
logger.silly(`Shop role ${roleId} is not due for payment.`);
|
||||||
|
|
|
@ -15,7 +15,7 @@ export const execute = async (client: Client) => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
if (nextPayment > now) {
|
if (nextPayment > now) {
|
||||||
await dueForPayment.execute(client, role);
|
dueForPayment.execute(client, role);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue