Clean up imports

This commit is contained in:
Ethan Lane 2022-09-17 15:05:54 +01:00
parent 5758cbd7f0
commit 8ee8bf5e9f
Signed by: Vylpes
GPG key ID: EED233CC06D12504
26 changed files with 10 additions and 63 deletions

View file

@ -1,7 +1,6 @@
import { Client } from "discord.js"; import { Client } from "discord.js";
import * as dotenv from "dotenv"; import * as dotenv from "dotenv";
import { createConnection } from "typeorm"; import { createConnection } from "typeorm";
import DefaultValues from "../constants/DefaultValues";
import ICommandItem from "../contracts/ICommandItem"; import ICommandItem from "../contracts/ICommandItem";
import IEventItem from "../contracts/IEventItem"; import IEventItem from "../contracts/IEventItem";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -1,19 +1,12 @@
import { CommandInteraction, GuildMemberRoleManager, Interaction, Message, messageLink } from "discord.js"; import { GuildMemberRoleManager, Interaction } from "discord.js";
import { CommandResponse } from "../constants/CommandResponse"; import { CommandResponse } from "../constants/CommandResponse";
import ErrorMessages from "../constants/ErrorMessages"; import ErrorMessages from "../constants/ErrorMessages";
import ICommandItem from "../contracts/ICommandItem"; import ICommandItem from "../contracts/ICommandItem";
import SettingsHelper from "../helpers/SettingsHelper"; import SettingsHelper from "../helpers/SettingsHelper";
import StringTools from "../helpers/StringTools"; import StringTools from "../helpers/StringTools";
import { CoreClient } from "./client"; import { CoreClient } from "./client";
import { Util } from "./util";
export class Events { export class Events {
private _util: Util;
constructor() {
this._util = new Util();
}
public async onInteractionCreate(interaction: Interaction) { public async onInteractionCreate(interaction: Interaction) {
if (!interaction.isChatInputCommand()) return; if (!interaction.isChatInputCommand()) return;
if (!interaction.guild) return; if (!interaction.guild) return;

View file

@ -1,15 +1,7 @@
// Required Components import { Client, REST, Routes, SlashCommandBuilder } from "discord.js";
import { Client, Message, REST, Routes, SlashCommandBuilder } from "discord.js";
import { ICommandContext } from "../contracts/ICommandContext";
import ICommandItem from "../contracts/ICommandItem";
import IEventItem from "../contracts/IEventItem"; import IEventItem from "../contracts/IEventItem";
import SettingsHelper from "../helpers/SettingsHelper";
import StringTools from "../helpers/StringTools";
import { CommandResponse } from "../constants/CommandResponse";
import ErrorMessages from "../constants/ErrorMessages";
import { CoreClient } from "./client"; import { CoreClient } from "./client";
// Util Class
export class Util { export class Util {
public loadSlashCommands(client: Client) { public loadSlashCommands(client: Client) {
const registeredCommands = CoreClient.commandItems; const registeredCommands = CoreClient.commandItems;

View file

@ -1,6 +1,5 @@
import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js"; import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js";
import EmbedColours from "../../constants/EmbedColours"; import EmbedColours from "../../constants/EmbedColours";
import { ICommandContext } from "../../contracts/ICommandContext";
import SettingsHelper from "../../helpers/SettingsHelper"; import SettingsHelper from "../../helpers/SettingsHelper";
import { Command } from "../../type/command"; import { Command } from "../../type/command";

View file

@ -1,9 +1,7 @@
import { CommandInteraction, GuildMemberRoleManager, SlashCommandBuilder, TextChannel } from "discord.js"; import { CommandInteraction, GuildMemberRoleManager, SlashCommandBuilder } from "discord.js";
import { ICommandContext } from "../../contracts/ICommandContext";
import { Command } from "../../type/command"; import { Command } from "../../type/command";
import { default as eLobby } from "../../entity/501231711271780357/Lobby"; import { default as eLobby } from "../../entity/501231711271780357/Lobby";
import SettingsHelper from "../../helpers/SettingsHelper"; import SettingsHelper from "../../helpers/SettingsHelper";
import { readFileSync } from "fs";
import BaseEntity from "../../contracts/BaseEntity"; import BaseEntity from "../../contracts/BaseEntity";
export default class Lobby extends Command { export default class Lobby extends Command {

View file

@ -1,6 +1,5 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, EmbedBuilder, Interaction, SlashCommandBuilder } from "discord.js"; import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";
import { ICommandContext } from "../contracts/ICommandContext";
import { Command } from "../type/command"; import { Command } from "../type/command";
export default class About extends Command { export default class About extends Command {

View file

@ -1,8 +1,6 @@
import { ICommandContext } from "../contracts/ICommandContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import AuditTools from "../helpers/AuditTools"; import AuditTools from "../helpers/AuditTools";
import { Command } from "../type/command"; import { Command } from "../type/command";
import SettingsHelper from "../helpers/SettingsHelper";
import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js"; import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js";
import { AuditType } from "../constants/AuditType"; import { AuditType } from "../constants/AuditType";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";

View file

@ -1,6 +1,4 @@
import ErrorMessages from "../constants/ErrorMessages";
import { Command } from "../type/command"; import { Command } from "../type/command";
import { ICommandContext } from "../contracts/ICommandContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import { AuditType } from "../constants/AuditType"; import { AuditType } from "../constants/AuditType";
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js"; import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";

View file

@ -1,5 +1,4 @@
import { Command } from "../type/command"; import { Command } from "../type/command";
import { ICommandContext } from "../contracts/ICommandContext";
import randomBunny from "random-bunny"; import randomBunny from "random-bunny";
import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js"; import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";

View file

@ -1,6 +1,5 @@
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js"; import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
import { Command } from "../type/command"; import { Command } from "../type/command";
import { ICommandContext } from "../contracts/ICommandContext";
export default class Clear extends Command { export default class Clear extends Command {
constructor() { constructor() {

View file

@ -1,6 +1,5 @@
import { CommandInteraction, EmbedBuilder, SlashCommandBuilder, SlashCommandSubcommandBuilder } from "discord.js"; import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js";
import { CommandResponse } from "../constants/CommandResponse"; import { CommandResponse } from "../constants/CommandResponse";
import { ICommandContext } from "../contracts/ICommandContext";
import SettingsHelper from "../helpers/SettingsHelper"; import SettingsHelper from "../helpers/SettingsHelper";
import StringTools from "../helpers/StringTools"; import StringTools from "../helpers/StringTools";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -3,7 +3,6 @@ import { readFileSync } from "fs";
import { CommandResponse } from "../constants/CommandResponse"; import { CommandResponse } from "../constants/CommandResponse";
import DefaultValues from "../constants/DefaultValues"; import DefaultValues from "../constants/DefaultValues";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";
import { ICommandContext } from "../contracts/ICommandContext";
import Server from "../entity/Server"; import Server from "../entity/Server";
import Setting from "../entity/Setting"; import Setting from "../entity/Setting";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -1,5 +1,4 @@
import { CommandInteraction, SlashCommandBuilder } from "discord.js"; import { CommandInteraction, SlashCommandBuilder } from "discord.js";
import { ICommandContext } from "../contracts/ICommandContext";
import SettingsHelper from "../helpers/SettingsHelper"; import SettingsHelper from "../helpers/SettingsHelper";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -1,5 +1,4 @@
import { CommandInteraction, SlashCommandBuilder } from "discord.js"; import { CommandInteraction, SlashCommandBuilder } from "discord.js";
import { ICommandContext } from "../contracts/ICommandContext";
import IgnoredChannel from "../entity/IgnoredChannel"; import IgnoredChannel from "../entity/IgnoredChannel";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -1,6 +1,4 @@
import ErrorMessages from "../constants/ErrorMessages";
import { Command } from "../type/command"; import { Command } from "../type/command";
import { ICommandContext } from "../contracts/ICommandContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import { AuditType } from "../constants/AuditType"; import { AuditType } from "../constants/AuditType";
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js"; import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";

View file

@ -1,8 +1,6 @@
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js"; import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
import { AuditType } from "../constants/AuditType"; import { AuditType } from "../constants/AuditType";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";
import ErrorMessages from "../constants/ErrorMessages";
import { ICommandContext } from "../contracts/ICommandContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import SettingsHelper from "../helpers/SettingsHelper"; import SettingsHelper from "../helpers/SettingsHelper";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -1,10 +1,7 @@
import { CommandInteraction, EmbedBuilder, GuildMemberRoleManager, Role as DiscordRole, SlashCommandBuilder } from "discord.js"; import { CommandInteraction, EmbedBuilder, GuildMemberRoleManager, SlashCommandBuilder } from "discord.js";
import { Command } from "../type/command"; import { Command } from "../type/command";
import { ICommandContext } from "../contracts/ICommandContext";
import SettingsHelper from "../helpers/SettingsHelper"; import SettingsHelper from "../helpers/SettingsHelper";
import { readFileSync } from "fs";
import { default as eRole } from "../entity/Role"; import { default as eRole } from "../entity/Role";
import Server from "../entity/Server";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";
export default class Role extends Command { export default class Role extends Command {

View file

@ -1,7 +1,6 @@
import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js"; import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js";
import { existsSync, readFileSync } from "fs"; import { existsSync, readFileSync } from "fs";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";
import { ICommandContext } from "../contracts/ICommandContext";
import { Command } from "../type/command"; import { Command } from "../type/command";
interface IRules { interface IRules {

View file

@ -1,5 +1,4 @@
import { CommandInteraction, SlashCommandBuilder } from "discord.js"; import { CommandInteraction, SlashCommandBuilder } from "discord.js";
import { ICommandContext } from "../contracts/ICommandContext";
import Server from "../entity/Server"; import Server from "../entity/Server";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -1,9 +1,5 @@
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js"; import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
import { AuditType } from "../constants/AuditType";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";
import ErrorMessages from "../constants/ErrorMessages";
import { ICommandContext } from "../contracts/ICommandContext";
import Audit from "../entity/Audit";
import SettingsHelper from "../helpers/SettingsHelper"; import SettingsHelper from "../helpers/SettingsHelper";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -1,8 +1,6 @@
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js"; import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
import { AuditType } from "../constants/AuditType"; import { AuditType } from "../constants/AuditType";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";
import ErrorMessages from "../constants/ErrorMessages";
import { ICommandContext } from "../contracts/ICommandContext";
import Audit from "../entity/Audit"; import Audit from "../entity/Audit";
import SettingsHelper from "../helpers/SettingsHelper"; import SettingsHelper from "../helpers/SettingsHelper";
import { Command } from "../type/command"; import { Command } from "../type/command";

View file

@ -1,7 +0,0 @@
import { Message } from "discord.js";
export interface ICommandContext {
name: string;
args: string[];
message: Message;
}

View file

@ -1,4 +1,4 @@
import { Column, Entity, getConnection, ManyToOne } from "typeorm"; import { Column, Entity, getConnection } from "typeorm";
import { AuditType } from "../constants/AuditType"; import { AuditType } from "../constants/AuditType";
import BaseEntity from "../contracts/BaseEntity"; import BaseEntity from "../contracts/BaseEntity";
import StringTools from "../helpers/StringTools"; import StringTools from "../helpers/StringTools";

View file

@ -1,4 +1,4 @@
import { Column, Entity, EntityTarget, getConnection, ManyToOne } from "typeorm"; import { Column, Entity, getConnection, ManyToOne } from "typeorm";
import BaseEntity from "../contracts/BaseEntity" import BaseEntity from "../contracts/BaseEntity"
import Server from "./Server"; import Server from "./Server";

View file

@ -1,5 +1,5 @@
import { Event } from "../type/event"; import { Event } from "../type/event";
import { EmbedBuilder, GuildChannel, GuildMember, TextChannel } from "discord.js"; import { EmbedBuilder, GuildMember, TextChannel } from "discord.js";
import GuildMemberUpdate from "./MemberEvents/GuildMemberUpdate"; import GuildMemberUpdate from "./MemberEvents/GuildMemberUpdate";
import SettingsHelper from "../helpers/SettingsHelper"; import SettingsHelper from "../helpers/SettingsHelper";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";

View file

@ -1,6 +1,5 @@
import { CommandResponse } from "../constants/CommandResponse"; import { CommandResponse } from "../constants/CommandResponse";
import { ICommandContext } from "../contracts/ICommandContext"; import { CommandInteraction } from "discord.js";
import { CommandInteraction, Interaction, SlashCommandBuilder } from "discord.js";
export class Command { export class Command {
public CommandBuilder: any; public CommandBuilder: any;