🎨 reorganized files
This commit is contained in:
parent
7281a4e53b
commit
9536478730
51 changed files with 48 additions and 252 deletions
|
@ -2,7 +2,7 @@
|
||||||
import { ButtonInteraction, CommandInteraction, Message } from "discord.js";
|
import { ButtonInteraction, CommandInteraction, Message } from "discord.js";
|
||||||
import addSeconds from "../../helpers/addSeconds";
|
import addSeconds from "../../helpers/addSeconds";
|
||||||
import logger from "../../middlewares/logger";
|
import logger from "../../middlewares/logger";
|
||||||
import prisma from "../../prisma";
|
import prisma from "../database";
|
||||||
|
|
||||||
export const command = async (i: CommandInteraction, cooldown: number) => {
|
export const command = async (i: CommandInteraction, cooldown: number) => {
|
||||||
const { guild, user, commandId } = i;
|
const { guild, user, commandId } = i;
|
|
@ -1,5 +1,5 @@
|
||||||
import { BaseInteraction, EmbedBuilder } from "discord.js";
|
import { BaseInteraction, EmbedBuilder } from "discord.js";
|
||||||
import getEmbedConfig from "../getEmbedData";
|
import getEmbedConfig from "../../helpers/getEmbedData";
|
||||||
|
|
||||||
export default async (interaction: BaseInteraction, ephemeral: boolean) => {
|
export default async (interaction: BaseInteraction, ephemeral: boolean) => {
|
||||||
if (!interaction.isRepliable())
|
if (!interaction.isRepliable())
|
|
@ -1,18 +1,18 @@
|
||||||
import { Client } from "discord.js";
|
import { Client } from "discord.js";
|
||||||
import schedule from "node-schedule";
|
import schedule from "node-schedule";
|
||||||
import listDir from "../../helpers/checkDirectory";
|
import checkDirectory from "../../helpers/checkDirectory";
|
||||||
import { IJob } from "../../interfaces/Job";
|
import { IJob } from "../../interfaces/Job";
|
||||||
import logger from "../../middlewares/logger";
|
import logger from "../../middlewares/logger";
|
||||||
|
|
||||||
export const start = async (client: Client) => {
|
export const start = async (client: Client) => {
|
||||||
logger.info("⏰ Started job management");
|
logger.info("⏰ Started job management");
|
||||||
|
|
||||||
const jobNames = await listDir("jobs");
|
const jobNames = await checkDirectory("schedules");
|
||||||
if (!jobNames) return logger.warn("No available jobs found");
|
if (!jobNames) return logger.warn("No available jobs found");
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
jobNames.map(async (jobName) => {
|
jobNames.map(async (jobName) => {
|
||||||
const job: IJob = await import(`../../jobs/${jobName}`);
|
const job: IJob = await import(`../../schedules/${jobName}`);
|
||||||
|
|
||||||
schedule.scheduleJob(job.options.schedule, async () => {
|
schedule.scheduleJob(job.options.schedule, async () => {
|
||||||
logger.verbose(`⏰ Performed the job "${jobName}"`);
|
logger.verbose(`⏰ Performed the job "${jobName}"`);
|
|
@ -1,8 +0,0 @@
|
||||||
import { EmbedBuilder } from "discord.js";
|
|
||||||
|
|
||||||
export default new EmbedBuilder()
|
|
||||||
.setFooter({
|
|
||||||
text: process.env.EMBED_FOOTER_TEXT,
|
|
||||||
iconURL: process.env.EMBED_FOOTER_ICON,
|
|
||||||
})
|
|
||||||
.setTimestamp(new Date());
|
|
|
@ -1,43 +0,0 @@
|
||||||
/* eslint-disable no-loops/no-loops */
|
|
||||||
|
|
||||||
import { SlashCommandBuilder } from "discord.js";
|
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
import getPluginCommands from "../getPluginCommands";
|
|
||||||
import getPlugins from "../getPlugins";
|
|
||||||
|
|
||||||
export default async () => {
|
|
||||||
logger.debug("Processing complete builder for plugins");
|
|
||||||
const plugins = await getPlugins("plugins");
|
|
||||||
const pluginBuilders = [];
|
|
||||||
|
|
||||||
for await (const plugin of plugins) {
|
|
||||||
logger.debug(`Processing builder for plugin: ${plugin}`);
|
|
||||||
|
|
||||||
const commands = await getPluginCommands(plugin);
|
|
||||||
|
|
||||||
const builderStructure = new SlashCommandBuilder()
|
|
||||||
.setName(plugin)
|
|
||||||
.setDescription("Get info about a user or a server!");
|
|
||||||
|
|
||||||
for await (const command of commands) {
|
|
||||||
logger.debug(`Processing builder of command: ${command.name}`);
|
|
||||||
if (command?.options?.group) {
|
|
||||||
logger.debug(`Processing subcommand group: ${command.builder.name}`);
|
|
||||||
builderStructure.addSubcommandGroup(command.builder);
|
|
||||||
logger.verbose(`Processed subcommand group: ${command.builder.name}!`);
|
|
||||||
} else {
|
|
||||||
logger.debug(`Processing subcommand: ${command.builder.name}`);
|
|
||||||
builderStructure.addSubcommand(command.builder);
|
|
||||||
logger.verbose(`Processed subcommand: ${command.builder.name}!`);
|
|
||||||
}
|
|
||||||
logger.verbose(`Processed builder of command: ${command.name}!`);
|
|
||||||
}
|
|
||||||
|
|
||||||
pluginBuilders.push(builderStructure);
|
|
||||||
|
|
||||||
logger.verbose(`Processed builder for plugin: ${plugin}!`);
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.verbose("Processed complete builder for plugins!");
|
|
||||||
return pluginBuilders;
|
|
||||||
};
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ColorResolvable, Guild } from "discord.js";
|
import { ColorResolvable, Guild } from "discord.js";
|
||||||
|
import prisma from "../../handlers/database";
|
||||||
import logger from "../../middlewares/logger";
|
import logger from "../../middlewares/logger";
|
||||||
import prisma from "../../prisma";
|
|
||||||
|
|
||||||
export default async (guild?: Guild | null) => {
|
export default async (guild?: Guild | null) => {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
|
|
||||||
export default async (plugin: string, command: string) => {
|
|
||||||
logger.debug(`Processing builder for command: ${command}`);
|
|
||||||
const { builder } = await import(
|
|
||||||
`../../plugins/${plugin}/commands/${command}`
|
|
||||||
);
|
|
||||||
logger.verbose(`Processed builder for command: ${command}!`);
|
|
||||||
|
|
||||||
return builder;
|
|
||||||
};
|
|
|
@ -1,10 +0,0 @@
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
|
|
||||||
export default async (plugin: string, command: string) => {
|
|
||||||
logger.debug(`Processing options for command: ${command}`);
|
|
||||||
const { options } =
|
|
||||||
(await import(`../../plugins/${plugin}/commands/${command}`)) || [];
|
|
||||||
logger.verbose(`Processed options for command: ${command}!`);
|
|
||||||
|
|
||||||
return options;
|
|
||||||
};
|
|
|
@ -1,24 +0,0 @@
|
||||||
/* eslint-disable no-loops/no-loops */
|
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
import listDir from "../checkDirectory";
|
|
||||||
import getPluginCommandBuilder from "../getPluginCommandBuilder";
|
|
||||||
import getPluginCommandOptions from "../getPluginCommandOptions";
|
|
||||||
|
|
||||||
export default async (plugin: string) => {
|
|
||||||
logger.debug(`Processing commands for plugin: ${plugin}`);
|
|
||||||
const commands = (await listDir(`plugins/${plugin}/commands`)) || [];
|
|
||||||
const commandStructure = [];
|
|
||||||
|
|
||||||
for await (const command of commands) {
|
|
||||||
logger.debug(`Processing command: ${command}`);
|
|
||||||
|
|
||||||
const builder = await getPluginCommandBuilder(plugin, command);
|
|
||||||
const options = await getPluginCommandOptions(plugin, command);
|
|
||||||
|
|
||||||
commandStructure.push({ name: command, builder, options });
|
|
||||||
logger.verbose(`Processed command: ${command}!`);
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.verbose(`Processed commands for plugin: ${plugin}!`);
|
|
||||||
return commandStructure;
|
|
||||||
};
|
|
|
@ -1,8 +0,0 @@
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
|
|
||||||
export default async (plugin: string) => {
|
|
||||||
logger.debug(`Processing metadata for plugin: ${plugin}`);
|
|
||||||
const metadata = await import(`../../plugins/${plugin}/metadata`);
|
|
||||||
logger.verbose(`Processed metadata for plugin: ${plugin}!`);
|
|
||||||
return metadata.default;
|
|
||||||
};
|
|
|
@ -1,34 +0,0 @@
|
||||||
/* eslint-disable no-loops/no-loops */
|
|
||||||
|
|
||||||
import { Client } from "discord.js";
|
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
import getPluginCommands from "../getPluginCommands";
|
|
||||||
import getPluginMetadata from "../getPluginMetadata";
|
|
||||||
import getPlugins from "../getPlugins";
|
|
||||||
|
|
||||||
export default async (client: Client, dir: string) => {
|
|
||||||
const plugins = await getPlugins(dir);
|
|
||||||
const pluginStructure = [];
|
|
||||||
|
|
||||||
logger.debug("Processing structure of plugins...");
|
|
||||||
|
|
||||||
for await (const plugin of plugins) {
|
|
||||||
logger.debug(`Processing structure of plugin: ${plugin}`);
|
|
||||||
const commands = await getPluginCommands(plugin);
|
|
||||||
const metadata = await getPluginMetadata(plugin);
|
|
||||||
|
|
||||||
pluginStructure.push({
|
|
||||||
plugin,
|
|
||||||
commands,
|
|
||||||
metadata,
|
|
||||||
});
|
|
||||||
|
|
||||||
client.commands.set(plugin, commands);
|
|
||||||
|
|
||||||
logger.verbose(`Processed structure of plugin: ${plugin}!`);
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.verbose("Processed structure of plugins!");
|
|
||||||
|
|
||||||
return pluginStructure;
|
|
||||||
};
|
|
|
@ -1,10 +0,0 @@
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
import listDir from "../checkDirectory";
|
|
||||||
|
|
||||||
export default async (dir: string) => {
|
|
||||||
logger.debug("Processing list of plugins...");
|
|
||||||
const plugins = await listDir(dir);
|
|
||||||
logger.verbose("Processed list of plugins!");
|
|
||||||
|
|
||||||
return plugins || [];
|
|
||||||
};
|
|
|
@ -1,22 +0,0 @@
|
||||||
import { REST } from "@discordjs/rest";
|
|
||||||
import { Routes, SlashCommandBuilder } from "discord.js";
|
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
|
|
||||||
export default async (builder: SlashCommandBuilder) => {
|
|
||||||
const rest = new REST({ version: "10" }).setToken(process.env.DISCORD_TOKEN);
|
|
||||||
|
|
||||||
await rest.put(
|
|
||||||
Routes.applicationGuildCommands(
|
|
||||||
process.env.DISCORD_CLIENT_ID,
|
|
||||||
process.env.DISCORD_GUILD_ID
|
|
||||||
),
|
|
||||||
{ body: builder }
|
|
||||||
);
|
|
||||||
|
|
||||||
await rest
|
|
||||||
.put(Routes.applicationCommands(process.env.DISCORD_CLIENT_ID as string), {
|
|
||||||
body: builder,
|
|
||||||
})
|
|
||||||
.then(() => logger.info("Successfully deployed to Discord"))
|
|
||||||
.catch(() => logger.error("Failed to deployed to Discord"));
|
|
||||||
};
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Guild, User } from "discord.js";
|
import { Guild, User } from "discord.js";
|
||||||
import prisma from "../prisma";
|
import prisma from "../../handlers/database";
|
||||||
|
|
||||||
export default async (guild: Guild, from: User, to: User, amount: number) => {
|
export default async (guild: Guild, from: User, to: User, amount: number) => {
|
||||||
return await prisma.$transaction(async (tx) => {
|
return await prisma.$transaction(async (tx) => {
|
|
@ -1,7 +1,8 @@
|
||||||
import { Client, Collection, GatewayIntentBits } from "discord.js"; // discord.js
|
import { Client, Collection, GatewayIntentBits } from "discord.js"; // discord.js
|
||||||
import "dotenv/config";
|
import "dotenv/config";
|
||||||
import * as managers from "./managers";
|
import * as command from "./handlers/command";
|
||||||
|
import * as event from "./handlers/event";
|
||||||
|
import * as schedule from "./handlers/schedule";
|
||||||
|
|
||||||
// Main process that starts all other sub processes
|
// Main process that starts all other sub processes
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
|
@ -18,7 +19,9 @@ const main = async () => {
|
||||||
// Create command collection
|
// Create command collection
|
||||||
client.commands = new Collection();
|
client.commands = new Collection();
|
||||||
|
|
||||||
await managers.start(client);
|
await schedule.start(client);
|
||||||
|
await event.register(client);
|
||||||
|
await command.register(client);
|
||||||
|
|
||||||
// Authorize with Discord's API
|
// Authorize with Discord's API
|
||||||
await client.login(process.env.DISCORD_TOKEN);
|
await client.login(process.env.DISCORD_TOKEN);
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
import mongoose from "mongoose";
|
|
||||||
import logger from "../../middlewares/logger";
|
|
||||||
|
|
||||||
// Function to connect to MongoDB server
|
|
||||||
export const connect = async () => {
|
|
||||||
await mongoose
|
|
||||||
.connect(process.env.MONGO_URL)
|
|
||||||
.then((connection) => {
|
|
||||||
logger.info(`💾 Connected to database: ${connection.connection.name}`);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
throw new Error("Error connecting to database.");
|
|
||||||
});
|
|
||||||
|
|
||||||
mongoose.connection.on("error", () => {
|
|
||||||
throw new Error("Failed to connect to database.");
|
|
||||||
});
|
|
||||||
|
|
||||||
mongoose.connection.on("warn", (warning) => {
|
|
||||||
logger.warn(`💾 ${warning}`);
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -1,12 +0,0 @@
|
||||||
import { Client } from "discord.js";
|
|
||||||
|
|
||||||
import * as command from "./command";
|
|
||||||
import * as event from "./event";
|
|
||||||
import * as schedule from "./schedule";
|
|
||||||
|
|
||||||
export const start = async (client: Client) => {
|
|
||||||
// await database.connect();
|
|
||||||
await schedule.start(client);
|
|
||||||
await command.register(client);
|
|
||||||
await event.register(client);
|
|
||||||
};
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ChatInputCommandInteraction, ColorResolvable } from "discord.js";
|
import { ChatInputCommandInteraction, ColorResolvable } from "discord.js";
|
||||||
|
import prisma from "../../../../../../../handlers/database";
|
||||||
import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
||||||
import logger from "../../../../../../../middlewares/logger";
|
import logger from "../../../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../../../prisma";
|
|
||||||
|
|
||||||
export default async (interaction: ChatInputCommandInteraction) => {
|
export default async (interaction: ChatInputCommandInteraction) => {
|
||||||
const { options, guild } = interaction;
|
const { options, guild } = interaction;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||||
import { ChannelType } from "discord-api-types/v10";
|
import { ChannelType } from "discord-api-types/v10";
|
||||||
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
||||||
|
import prisma from "../../../../../handlers/database";
|
||||||
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
||||||
import prisma from "../../../../../prisma";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metadata: { guildOnly: true, ephemeral: false },
|
metadata: { guildOnly: true, ephemeral: false },
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
||||||
|
import prisma from "../../../../../handlers/database";
|
||||||
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
||||||
import logger from "../../../../../middlewares/logger";
|
import logger from "../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../prisma";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metadata: { guildOnly: true, ephemeral: true },
|
metadata: { guildOnly: true, ephemeral: true },
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||||
import { GuildMember } from "@prisma/client";
|
import { GuildMember } from "@prisma/client";
|
||||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
||||||
|
import prisma from "../../../../../handlers/database";
|
||||||
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
||||||
import logger from "../../../../../middlewares/logger";
|
import logger from "../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../prisma";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metadata: { guildOnly: true, ephemeral: false },
|
metadata: { guildOnly: true, ephemeral: false },
|
||||||
|
|
|
@ -3,13 +3,13 @@ import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||||
import Chance from "chance";
|
import Chance from "chance";
|
||||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
||||||
// Models
|
// Models
|
||||||
import * as cooldown from "../../../../../helpers/cooldown";
|
import * as cooldown from "../../../../../handlers/cooldown";
|
||||||
// Configurations
|
// Configurations
|
||||||
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
||||||
// Helpers
|
// Helpers
|
||||||
// Handlers
|
// Handlers
|
||||||
|
import prisma from "../../../../../handlers/database";
|
||||||
import logger from "../../../../../middlewares/logger";
|
import logger from "../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../prisma";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metadata: { guildOnly: true, ephemeral: true },
|
metadata: { guildOnly: true, ephemeral: true },
|
||||||
|
|
|
@ -7,9 +7,9 @@ import {
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
// Configurations
|
// Configurations
|
||||||
|
import prisma from "../../../../../../../handlers/database";
|
||||||
import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
||||||
import logger from "../../../../../../../middlewares/logger";
|
import logger from "../../../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../../../prisma";
|
|
||||||
|
|
||||||
// Function
|
// Function
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import {
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
// Configurations
|
// Configurations
|
||||||
|
import prisma from "../../../../../../../handlers/database";
|
||||||
import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
||||||
import prisma from "../../../../../../../prisma";
|
|
||||||
|
|
||||||
// Function
|
// Function
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
||||||
import pluralize from "../../../../../../../helpers/pluralize";
|
import pluralize from "../../../../../../../helpers/pluralize";
|
||||||
// Models
|
// Models
|
||||||
// Handlers
|
// Handlers
|
||||||
import prisma from "../../../../../../../prisma";
|
import prisma from "../../../../../../../handlers/database";
|
||||||
// Function
|
// Function
|
||||||
export default {
|
export default {
|
||||||
metadata: {
|
metadata: {
|
||||||
|
|
|
@ -10,8 +10,8 @@ import {
|
||||||
// Configurations
|
// Configurations
|
||||||
import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
||||||
// Handlers
|
// Handlers
|
||||||
|
import prisma from "../../../../../../../handlers/database";
|
||||||
import logger from "../../../../../../../middlewares/logger";
|
import logger from "../../../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../../../prisma";
|
|
||||||
|
|
||||||
// Function
|
// Function
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -11,8 +11,8 @@ import getEmbedConfig from "../../../../../../../helpers/getEmbedData";
|
||||||
// Helpers../../../../../../../helpers/userData
|
// Helpers../../../../../../../helpers/userData
|
||||||
import pluralize from "../../../../../../../helpers/pluralize";
|
import pluralize from "../../../../../../../helpers/pluralize";
|
||||||
// Handlers
|
// Handlers
|
||||||
|
import prisma from "../../../../../../../handlers/database";
|
||||||
import logger from "../../../../../../../middlewares/logger";
|
import logger from "../../../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../../../prisma";
|
|
||||||
|
|
||||||
// Function
|
// Function
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||||
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
||||||
import { command as CooldownCommand } from "../../../../../helpers/cooldown";
|
import { command as CooldownCommand } from "../../../../../handlers/cooldown";
|
||||||
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../../helpers/getEmbedData";
|
||||||
import logger from "../../../../../middlewares/logger";
|
import logger from "../../../../../middlewares/logger";
|
||||||
import noSelfReputation from "./components/noSelfReputation";
|
import noSelfReputation from "./components/noSelfReputation";
|
||||||
|
|
||||||
import prisma from "../../../../../prisma";
|
import prisma from "../../../../../handlers/database";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metadata: { guildOnly: true, ephemeral: true },
|
metadata: { guildOnly: true, ephemeral: true },
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Guild } from "discord.js";
|
import { Guild } from "discord.js";
|
||||||
import updatePresence from "../../../helpers/updatePresence";
|
import prisma from "../../../handlers/database";
|
||||||
|
import updatePresence from "../../../handlers/updatePresence";
|
||||||
import { IEventOptions } from "../../../interfaces/EventOptions";
|
import { IEventOptions } from "../../../interfaces/EventOptions";
|
||||||
import logger from "../../../middlewares/logger";
|
import logger from "../../../middlewares/logger";
|
||||||
import prisma from "../../../prisma";
|
|
||||||
|
|
||||||
export const options: IEventOptions = {
|
export const options: IEventOptions = {
|
||||||
type: "on",
|
type: "on",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// 3rd party dependencies
|
// 3rd party dependencies
|
||||||
import { Guild } from "discord.js";
|
import { Guild } from "discord.js";
|
||||||
import updatePresence from "../../../helpers/updatePresence";
|
import prisma from "../../../handlers/database";
|
||||||
|
import updatePresence from "../../../handlers/updatePresence";
|
||||||
import { IEventOptions } from "../../../interfaces/EventOptions";
|
import { IEventOptions } from "../../../interfaces/EventOptions";
|
||||||
import logger from "../../../middlewares/logger";
|
import logger from "../../../middlewares/logger";
|
||||||
import prisma from "../../../prisma";
|
|
||||||
|
|
||||||
export const options: IEventOptions = {
|
export const options: IEventOptions = {
|
||||||
type: "on",
|
type: "on",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// 3rd party dependencies
|
// 3rd party dependencies
|
||||||
import { GuildMember } from "discord.js";
|
import { GuildMember } from "discord.js";
|
||||||
import updatePresence from "../../../helpers/updatePresence";
|
import prisma from "../../../handlers/database";
|
||||||
|
import updatePresence from "../../../handlers/updatePresence";
|
||||||
import { IEventOptions } from "../../../interfaces/EventOptions";
|
import { IEventOptions } from "../../../interfaces/EventOptions";
|
||||||
import logger from "../../../middlewares/logger";
|
import logger from "../../../middlewares/logger";
|
||||||
import prisma from "../../../prisma";
|
|
||||||
import audits from "./audits";
|
import audits from "./audits";
|
||||||
import joinMessage from "./joinMessage";
|
import joinMessage from "./joinMessage";
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// 3rd party dependencies
|
// 3rd party dependencies
|
||||||
import { GuildMember } from "discord.js";
|
import { GuildMember } from "discord.js";
|
||||||
import updatePresence from "../../../helpers/updatePresence";
|
import prisma from "../../../handlers/database";
|
||||||
|
import updatePresence from "../../../handlers/updatePresence";
|
||||||
import { IEventOptions } from "../../../interfaces/EventOptions";
|
import { IEventOptions } from "../../../interfaces/EventOptions";
|
||||||
import logger from "../../../middlewares/logger";
|
import logger from "../../../middlewares/logger";
|
||||||
import prisma from "../../../prisma";
|
|
||||||
import audits from "./audits";
|
import audits from "./audits";
|
||||||
import leaveMessage from "./leaveMessage";
|
import leaveMessage from "./leaveMessage";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { BaseInteraction } from "discord.js";
|
import { BaseInteraction } from "discord.js";
|
||||||
import { button as CooldownButton } from "../../../../../helpers/cooldown";
|
import { button as CooldownButton } from "../../../../../handlers/cooldown";
|
||||||
import deferReply from "../../../../../helpers/deferReply";
|
import deferReply from "../../../../../handlers/deferReply";
|
||||||
|
|
||||||
export default async (interaction: BaseInteraction) => {
|
export default async (interaction: BaseInteraction) => {
|
||||||
if (!interaction.isButton()) return;
|
if (!interaction.isButton()) return;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
import { ChatInputCommandInteraction } from "discord.js";
|
||||||
import { command as CooldownCommand } from "../../../../../helpers/cooldown";
|
import { command as CooldownCommand } from "../../../../../handlers/cooldown";
|
||||||
import deferReply from "../../../../../helpers/deferReply";
|
import deferReply from "../../../../../handlers/deferReply";
|
||||||
import getCommandMetadata from "../../../../../helpers/getCommandMetadata";
|
import getCommandMetadata from "../../../../../helpers/getCommandMetadata";
|
||||||
|
|
||||||
export default async (interaction: ChatInputCommandInteraction) => {
|
export default async (interaction: ChatInputCommandInteraction) => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ChannelType, Message } from "discord.js";
|
import { ChannelType, Message } from "discord.js";
|
||||||
|
import prisma from "../../../../../handlers/database";
|
||||||
import logger from "../../../../../middlewares/logger";
|
import logger from "../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../prisma";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
execute: async (message: Message) => {
|
execute: async (message: Message) => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ChannelType, Message } from "discord.js";
|
import { ChannelType, Message } from "discord.js";
|
||||||
import { message as CooldownMessage } from "../../../../../helpers/cooldown";
|
import { message as CooldownMessage } from "../../../../../handlers/cooldown";
|
||||||
|
import prisma from "../../../../../handlers/database";
|
||||||
import logger from "../../../../../middlewares/logger";
|
import logger from "../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../prisma";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
execute: async (message: Message) => {
|
execute: async (message: Message) => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ChannelType, Message } from "discord.js";
|
import { ChannelType, Message } from "discord.js";
|
||||||
import { message as CooldownMessage } from "../../../../../helpers/cooldown";
|
import { message as CooldownMessage } from "../../../../../handlers/cooldown";
|
||||||
|
import prisma from "../../../../../handlers/database";
|
||||||
import logger from "../../../../../middlewares/logger";
|
import logger from "../../../../../middlewares/logger";
|
||||||
import prisma from "../../../../../prisma";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
execute: async (message: Message) => {
|
execute: async (message: Message) => {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { Message } from "discord.js";
|
import { Message } from "discord.js";
|
||||||
// Models
|
// Models
|
||||||
|
import prisma from "../../../../handlers/database";
|
||||||
import logger from "../../../../middlewares/logger";
|
import logger from "../../../../middlewares/logger";
|
||||||
import prisma from "../../../../prisma";
|
|
||||||
|
|
||||||
export default async (message: Message) => {
|
export default async (message: Message) => {
|
||||||
const { guild, channel, author, content } = message;
|
const { guild, channel, author, content } = message;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { Message } from "discord.js";
|
import { Message } from "discord.js";
|
||||||
// Models
|
// Models
|
||||||
|
import prisma from "../../../../handlers/database";
|
||||||
import logger from "../../../../middlewares/logger";
|
import logger from "../../../../middlewares/logger";
|
||||||
import prisma from "../../../../prisma";
|
|
||||||
|
|
||||||
export default async (message: Message) => {
|
export default async (message: Message) => {
|
||||||
const { guild, channel, author, content } = message;
|
const { guild, channel, author, content } = message;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { Client } from "discord.js";
|
import { Client } from "discord.js";
|
||||||
// Helpers
|
// Helpers
|
||||||
import deployCommands from "../../../helpers/deployCommands";
|
import deployCommands from "../../../handlers/deployCommands";
|
||||||
import devMode from "../../../helpers/devMode";
|
import devMode from "../../../handlers/devMode";
|
||||||
import updatePresence from "../../../helpers/updatePresence";
|
import updatePresence from "../../../handlers/updatePresence";
|
||||||
import { IEventOptions } from "../../../interfaces/EventOptions";
|
import { IEventOptions } from "../../../interfaces/EventOptions";
|
||||||
import logger from "../../../middlewares/logger";
|
import logger from "../../../middlewares/logger";
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
import { PrismaClient } from "@prisma/client";
|
|
||||||
|
|
||||||
export default new PrismaClient();
|
|
Loading…
Add table
Reference in a new issue