Switch to TypeORM's DataSource API #299
37 changed files with 128 additions and 164 deletions
8
.dev.env
8
.dev.env
|
@ -15,3 +15,11 @@ BOT_CLIENTID=682942374040961060
|
|||
|
||||
ABOUT_FUNDING=https://ko-fi.com/vylpes
|
||||
ABOUT_REPO=https://gitea.vylpes.xyz/RabbitLabs/vylbot-app
|
||||
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3101
|
||||
DB_NAME=vylbot
|
||||
DB_AUTH_USER=dev
|
||||
DB_AUTH_PASS=dev
|
||||
DB_SYNC=true
|
||||
DB_LOGGING=true
|
|
@ -14,3 +14,11 @@ BOT_CLIENTID=680083120896081954
|
|||
|
||||
ABOUT_FUNDING=https://ko-fi.com/vylpes
|
||||
ABOUT_REPO=https://gitea.vylpes.xyz/RabbitLabs/vylbot-app
|
||||
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3121
|
||||
DB_NAME=vylbot
|
||||
DB_AUTH_USER=prod
|
||||
DB_AUTH_PASS=prod
|
||||
DB_SYNC=false
|
||||
DB_LOGGING=false
|
|
@ -14,3 +14,11 @@ BOT_CLIENTID=1016767908740857949
|
|||
|
||||
ABOUT_FUNDING=https://ko-fi.com/vylpes
|
||||
ABOUT_REPO=https://gitea.vylpes.xyz/RabbitLabs/vylbot-app
|
||||
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3111
|
||||
DB_NAME=vylbot
|
||||
DB_AUTH_USER=stage
|
||||
DB_AUTH_PASS=stage
|
||||
DB_SYNC=false
|
||||
DB_LOGGING=false
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"type": "mysql",
|
||||
"host": "localhost",
|
||||
"port": 3101,
|
||||
"username": "dev",
|
||||
"password": "dev",
|
||||
"database": "vylbot",
|
||||
"synchronize": false,
|
||||
"logging": false,
|
||||
"entities": [
|
||||
"dist/entity/**/*.js"
|
||||
],
|
||||
"migrations": [
|
||||
"dist/migration/**/*.js"
|
||||
],
|
||||
"subscribers": [
|
||||
"dist/subscriber/**/*.js"
|
||||
],
|
||||
"cli": {
|
||||
"entitiesDir": "dist/entity",
|
||||
"migrationsDir": "dist/migration",
|
||||
"subscribersDir": "dist/subscriber"
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"type": "mysql",
|
||||
"host": "localhost",
|
||||
"port": 3121,
|
||||
"username": "prod",
|
||||
"password": "prod",
|
||||
"database": "vylbot",
|
||||
"synchronize": false,
|
||||
"logging": false,
|
||||
"entities": [
|
||||
"dist/entity/**/*.js"
|
||||
],
|
||||
"migrations": [
|
||||
"dist/migration/**/*.js"
|
||||
],
|
||||
"subscribers": [
|
||||
"dist/subscriber/**/*.js"
|
||||
],
|
||||
"cli": {
|
||||
"entitiesDir": "dist/entity",
|
||||
"migrationsDir": "dist/migration",
|
||||
"subscribersDir": "dist/subscriber"
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"type": "mysql",
|
||||
"host": "localhost",
|
||||
"port": 3111,
|
||||
"username": "stage",
|
||||
"password": "stage",
|
||||
"database": "vylbot",
|
||||
"synchronize": false,
|
||||
"logging": false,
|
||||
"entities": [
|
||||
"dist/entity/**/*.js"
|
||||
],
|
||||
"migrations": [
|
||||
"dist/migration/**/*.js"
|
||||
],
|
||||
"subscribers": [
|
||||
"dist/subscriber/**/*.js"
|
||||
],
|
||||
"cli": {
|
||||
"entitiesDir": "dist/entity",
|
||||
"migrationsDir": "dist/migration",
|
||||
"subscribersDir": "dist/subscriber"
|
||||
}
|
||||
}
|
|
@ -9,8 +9,8 @@
|
|||
"build": "tsc",
|
||||
"start": "node ./dist/vylbot",
|
||||
"test": "jest",
|
||||
"db:up": "typeorm migration:run",
|
||||
"db:down": "typeorm migration:revert"
|
||||
"db:up": "typeorm migration:run -d dist/database/dataSources/appDataSource.js",
|
||||
"db:down": "typeorm migration:revert -d dist/database/dataSources/appDataSource.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -13,7 +13,6 @@ cd ~/apps/vylbot/vylbot_prod \
|
|||
&& (pm2 stop vylbot_prod || true) \
|
||||
&& (pm2 delete vylbot_prod || true) \
|
||||
&& cp .prod.env .env \
|
||||
&& cp ormconfig.prod.json ormconfig.json \
|
||||
&& yarn clean \
|
||||
&& yarn install --frozen-lockfile \
|
||||
&& yarn build \
|
||||
|
|
|
@ -13,7 +13,6 @@ cd ~/apps/vylbot/vylbot_stage \
|
|||
&& (pm2 stop vylbot_stage || true) \
|
||||
&& (pm2 delete vylbot_stage || true) \
|
||||
&& cp .stage.env .env \
|
||||
&& cp ormconfig.stage.json ormconfig.json \
|
||||
&& yarn clean \
|
||||
&& yarn install --frozen-lockfile \
|
||||
&& yarn build \
|
||||
|
|
|
@ -8,6 +8,7 @@ import { Command } from "../type/command";
|
|||
|
||||
import { Events } from "./events";
|
||||
import { Util } from "./util";
|
||||
import AppDataSource from "../database/dataSources/appDataSource";
|
||||
|
||||
export class CoreClient extends Client {
|
||||
private static _commandItems: ICommandItem[];
|
||||
|
@ -41,10 +42,9 @@ export class CoreClient extends Client {
|
|||
return;
|
||||
}
|
||||
|
||||
await createConnection().catch(e => {
|
||||
console.error(e);
|
||||
return;
|
||||
});
|
||||
await AppDataSource.initialize()
|
||||
.then(() => console.log("Data Source Initialized"))
|
||||
.catch((err) => console.error("Error Initialising Data Source", err));
|
||||
|
||||
super.on("interactionCreate", this._events.onInteractionCreate);
|
||||
super.on("ready", this._events.onReady);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import { Command } from "../../../type/command";
|
||||
import { default as eLobby } from "../../../entity/501231711271780357/Lobby";
|
||||
import { default as eLobby } from "../../../database/entities/501231711271780357/Lobby";
|
||||
|
||||
export default class AddRole extends Command {
|
||||
constructor() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { CacheType, CommandInteraction, EmbedBuilder, GuildBasedChannel, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import { Command } from "../../../type/command";
|
||||
import { default as eLobby } from "../../../entity/501231711271780357/Lobby";
|
||||
import { default as eLobby } from "../../../database/entities/501231711271780357/Lobby";
|
||||
import EmbedColours from "../../../constants/EmbedColours";
|
||||
|
||||
export default class ListLobby extends Command {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import { Command } from "../../../type/command";
|
||||
import { default as eLobby } from "../../../entity/501231711271780357/Lobby";
|
||||
import { default as eLobby } from "../../../database/entities/501231711271780357/Lobby";
|
||||
|
||||
export default class Lobby extends Command {
|
||||
constructor() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import { Command } from "../../../type/command";
|
||||
import { default as eLobby } from "../../../entity/501231711271780357/Lobby";
|
||||
import { default as eLobby } from "../../../database/entities/501231711271780357/Lobby";
|
||||
import BaseEntity from "../../../contracts/BaseEntity";
|
||||
|
||||
export default class RemoveLobby extends Command {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import { Command } from "../../type/command";
|
||||
import { default as eRole } from "../../entity/Role";
|
||||
import Server from "../../entity/Server";
|
||||
import { default as eRole } from "../../database/entities/Role";
|
||||
import Server from "../../database/entities/Server";
|
||||
|
||||
export default class ConfigRole extends Command {
|
||||
constructor() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { CommandInteraction, EmbedBuilder, GuildMemberRoleManager, SlashCommandBuilder } from "discord.js";
|
||||
import { Command } from "../../type/command";
|
||||
import { default as eRole } from "../../entity/Role";
|
||||
import { default as eRole } from "../../database/entities/Role";
|
||||
import EmbedColours from "../../constants/EmbedColours";
|
||||
|
||||
export default class Role extends Command {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Audit from "../entity/Audit";
|
||||
import Audit from "../database/entities/Audit";
|
||||
import AuditTools from "../helpers/AuditTools";
|
||||
import { Command } from "../type/command";
|
||||
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Command } from "../type/command";
|
||||
import Audit from "../entity/Audit";
|
||||
import Audit from "../database/entities/Audit";
|
||||
import { AuditType } from "../constants/AuditType";
|
||||
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import EmbedColours from "../constants/EmbedColours";
|
||||
|
|
|
@ -2,8 +2,8 @@ import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuil
|
|||
import { readFileSync } from "fs";
|
||||
import DefaultValues from "../constants/DefaultValues";
|
||||
import EmbedColours from "../constants/EmbedColours";
|
||||
import Server from "../entity/Server";
|
||||
import Setting from "../entity/Setting";
|
||||
import Server from "../database/entities/Server";
|
||||
import Setting from "../database/entities/Setting";
|
||||
import { Command } from "../type/command";
|
||||
|
||||
export default class Config extends Command {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import IgnoredChannel from "../entity/IgnoredChannel";
|
||||
import IgnoredChannel from "../database/entities/IgnoredChannel";
|
||||
import { Command } from "../type/command";
|
||||
|
||||
export default class Ignore extends Command {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Command } from "../type/command";
|
||||
import Audit from "../entity/Audit";
|
||||
import Audit from "../database/entities/Audit";
|
||||
import { AuditType } from "../constants/AuditType";
|
||||
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import EmbedColours from "../constants/EmbedColours";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import { AuditType } from "../constants/AuditType";
|
||||
import EmbedColours from "../constants/EmbedColours";
|
||||
import Audit from "../entity/Audit";
|
||||
import Audit from "../database/entities/Audit";
|
||||
import SettingsHelper from "../helpers/SettingsHelper";
|
||||
import { Command } from "../type/command";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import Server from "../entity/Server";
|
||||
import Server from "../database/entities/Server";
|
||||
import { Command } from "../type/command";
|
||||
|
||||
export default class Setup extends Command {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import { AuditType } from "../constants/AuditType";
|
||||
import EmbedColours from "../constants/EmbedColours";
|
||||
import Audit from "../entity/Audit";
|
||||
import Audit from "../database/entities/Audit";
|
||||
import SettingsHelper from "../helpers/SettingsHelper";
|
||||
import { Command } from "../type/command";
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Column, DeepPartial, EntityTarget, getConnection, PrimaryColumn, ObjectLiteral, FindOptionsWhere } from "typeorm";
|
||||
import { Column, DeepPartial, EntityTarget, PrimaryColumn, ObjectLiteral, FindOptionsWhere } from "typeorm";
|
||||
import { v4 } from "uuid";
|
||||
import AppDataSource from "../database/dataSources/appDataSource";
|
||||
|
||||
export default class BaseEntity {
|
||||
constructor() {
|
||||
|
@ -21,25 +22,19 @@ export default class BaseEntity {
|
|||
public async Save<T extends BaseEntity>(target: EntityTarget<T>, entity: DeepPartial<T>): Promise<void> {
|
||||
this.WhenUpdated = new Date();
|
||||
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository<T>(target);
|
||||
const repository = AppDataSource.getRepository<T>(target);
|
||||
|
||||
await repository.save(entity);
|
||||
}
|
||||
|
||||
public static async Remove<T extends BaseEntity>(target: EntityTarget<T>, entity: T): Promise<void> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository<T>(target);
|
||||
const repository = AppDataSource.getRepository<T>(target);
|
||||
|
||||
await repository.remove(entity);
|
||||
}
|
||||
|
||||
public static async FetchAll<T extends BaseEntity>(target: EntityTarget<T>, relations?: string[]): Promise<T[]> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository<T>(target);
|
||||
const repository = AppDataSource.getRepository<T>(target);
|
||||
|
||||
const all = await repository.find({ relations: relations || [] });
|
||||
|
||||
|
@ -47,9 +42,7 @@ export default class BaseEntity {
|
|||
}
|
||||
|
||||
public static async FetchOneById<T extends BaseEntity>(target: EntityTarget<T>, id: string, relations?: string[]): Promise<T | null> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository<T>(target);
|
||||
const repository = AppDataSource.getRepository<T>(target);
|
||||
|
||||
const single = await repository.findOne({ where: ({ Id: id } as FindOptionsWhere<T>), relations: relations || {} });
|
||||
|
||||
|
@ -57,9 +50,7 @@ export default class BaseEntity {
|
|||
}
|
||||
|
||||
public static async Any<T extends ObjectLiteral>(target: EntityTarget<T>): Promise<boolean> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository<T>(target);
|
||||
const repository = AppDataSource.getRepository<T>(target);
|
||||
|
||||
const any = await repository.find();
|
||||
|
||||
|
|
26
src/database/dataSources/appDataSource.ts
Normal file
26
src/database/dataSources/appDataSource.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { DataSource } from "typeorm";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const AppDataSource = new DataSource({
|
||||
type: "mysql",
|
||||
host: process.env.DB_HOST,
|
||||
port: Number(process.env.DB_PORT),
|
||||
username: process.env.DB_AUTH_USER,
|
||||
password: process.env.DB_AUTH_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
synchronize: process.env.DB_SYNC == "true",
|
||||
logging: process.env.DB_LOGGING == "true",
|
||||
entities: [
|
||||
"dist/database/entities/**/*.js",
|
||||
],
|
||||
migrations: [
|
||||
"dist/database/migrations/**/*.js",
|
||||
],
|
||||
subscribers: [
|
||||
"dist/database/subscribers/**/*.js",
|
||||
],
|
||||
});
|
||||
|
||||
export default AppDataSource;
|
|
@ -1,5 +1,6 @@
|
|||
import { Column, Entity, getConnection } from "typeorm";
|
||||
import BaseEntity from "../../contracts/BaseEntity";
|
||||
import { Column, Entity } from "typeorm";
|
||||
import BaseEntity from "../../../contracts/BaseEntity";
|
||||
import AppDataSource from "../../dataSources/appDataSource";
|
||||
|
||||
@Entity()
|
||||
export default class Lobby extends BaseEntity {
|
||||
|
@ -34,9 +35,7 @@ export default class Lobby extends BaseEntity {
|
|||
}
|
||||
|
||||
public static async FetchOneByChannelId(channelId: string, relations?: string[]): Promise<Lobby | null> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository(Lobby);
|
||||
const repository = AppDataSource.getRepository(Lobby);
|
||||
|
||||
const single = await repository.findOne({ where: { ChannelId: channelId }, relations: relations || [] });
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
import { Column, Entity, getConnection } from "typeorm";
|
||||
import { AuditType } from "../constants/AuditType";
|
||||
import BaseEntity from "../contracts/BaseEntity";
|
||||
import StringTools from "../helpers/StringTools";
|
||||
import { Column, Entity } from "typeorm";
|
||||
import { AuditType } from "../../constants/AuditType";
|
||||
import BaseEntity from "../../contracts/BaseEntity";
|
||||
import StringTools from "../../helpers/StringTools";
|
||||
import AppDataSource from "../dataSources/appDataSource";
|
||||
|
||||
@Entity()
|
||||
export default class Audit extends BaseEntity {
|
||||
|
@ -35,9 +36,7 @@ export default class Audit extends BaseEntity {
|
|||
ServerId: string;
|
||||
|
||||
public static async FetchAuditsByUserId(userId: string, serverId: string): Promise<Audit[] | null> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository(Audit);
|
||||
const repository = AppDataSource.getRepository(Audit);
|
||||
|
||||
const all = await repository.find({ where: { UserId: userId, ServerId: serverId } });
|
||||
|
||||
|
@ -45,9 +44,7 @@ export default class Audit extends BaseEntity {
|
|||
}
|
||||
|
||||
public static async FetchAuditByAuditId(auditId: string, serverId: string): Promise<Audit | null> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository(Audit);
|
||||
const repository = AppDataSource.getRepository(Audit);
|
||||
|
||||
const single = await repository.findOne({ where: { AuditId: auditId, ServerId: serverId } });
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import { Entity, getConnection } from "typeorm";
|
||||
import BaseEntity from "../contracts/BaseEntity";
|
||||
import { Entity } from "typeorm";
|
||||
import BaseEntity from "../../contracts/BaseEntity";
|
||||
import AppDataSource from "../dataSources/appDataSource";
|
||||
|
||||
@Entity()
|
||||
export default class IgnoredChannel extends BaseEntity {
|
||||
|
@ -10,9 +11,7 @@ export default class IgnoredChannel extends BaseEntity {
|
|||
}
|
||||
|
||||
public static async IsChannelIgnored(channelId: string): Promise<boolean> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository(IgnoredChannel);
|
||||
const repository = AppDataSource.getRepository(IgnoredChannel);
|
||||
|
||||
const single = await repository.findOne({ where: { Id: channelId } });
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { Column, Entity, getConnection, ManyToOne } from "typeorm";
|
||||
import BaseEntity from "../contracts/BaseEntity"
|
||||
import { Column, Entity, ManyToOne } from "typeorm";
|
||||
import BaseEntity from "../../contracts/BaseEntity"
|
||||
import Server from "./Server";
|
||||
import AppDataSource from "../dataSources/appDataSource";
|
||||
|
||||
@Entity()
|
||||
export default class Role extends BaseEntity {
|
||||
|
@ -21,9 +22,7 @@ export default class Role extends BaseEntity {
|
|||
}
|
||||
|
||||
public static async FetchOneByRoleId(roleId: string, relations?: string[]): Promise<Role | null> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository(Role);
|
||||
const repository = AppDataSource.getRepository(Role);
|
||||
|
||||
const single = await repository.findOne({ where: { RoleId: roleId }, relations: relations || []});
|
||||
|
||||
|
@ -31,9 +30,7 @@ export default class Role extends BaseEntity {
|
|||
}
|
||||
|
||||
public static async FetchAllByServerId(serverId: string): Promise<Role[]> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository(Server);
|
||||
const repository = AppDataSource.getRepository(Server);
|
||||
|
||||
const all = await repository.findOne({ where: { Id: serverId }, relations: [
|
||||
"Roles",
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, OneToMany } from "typeorm";
|
||||
import BaseEntity from "../contracts/BaseEntity";
|
||||
import BaseEntity from "../../contracts/BaseEntity";
|
||||
import Role from "./Role";
|
||||
import Setting from "./Setting";
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { Column, Entity, getConnection, ManyToOne } from "typeorm";
|
||||
import BaseEntity from "../contracts/BaseEntity";
|
||||
import { Column, Entity, ManyToOne } from "typeorm";
|
||||
import BaseEntity from "../../contracts/BaseEntity";
|
||||
import Server from "./Server";
|
||||
import AppDataSource from "../dataSources/appDataSource";
|
||||
|
||||
@Entity()
|
||||
export default class Setting extends BaseEntity {
|
||||
|
@ -26,9 +27,7 @@ export default class Setting extends BaseEntity {
|
|||
}
|
||||
|
||||
public static async FetchOneByKey(key: string, relations?: string[]): Promise<Setting | null> {
|
||||
const connection = getConnection();
|
||||
|
||||
const repository = connection.getRepository(Setting);
|
||||
const repository = AppDataSource.getRepository(Setting);
|
||||
|
||||
const single = await repository.findOne({ where: { Key: key }, relations: relations || {} });
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm"
|
||||
import MigrationHelper from "../../helpers/MigrationHelper"
|
||||
import MigrationHelper from "../../../helpers/MigrationHelper"
|
||||
|
||||
export class vylbot1662399171315 implements MigrationInterface {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { EmbedBuilder, Message, TextChannel } from "discord.js";
|
||||
import EmbedColours from "../../constants/EmbedColours";
|
||||
import IgnoredChannel from "../../entity/IgnoredChannel";
|
||||
import IgnoredChannel from "../../database/entities/IgnoredChannel";
|
||||
import SettingsHelper from "../../helpers/SettingsHelper";
|
||||
|
||||
export default async function MessageDelete(message: Message) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { EmbedBuilder, Message, TextChannel } from "discord.js";
|
||||
import EmbedColours from "../../constants/EmbedColours";
|
||||
import IgnoredChannel from "../../entity/IgnoredChannel";
|
||||
import IgnoredChannel from "../../database/entities/IgnoredChannel";
|
||||
import SettingsHelper from "../../helpers/SettingsHelper";
|
||||
|
||||
export default async function MessageUpdate(oldMessage: Message, newMessage: Message) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import DefaultValues from "../constants/DefaultValues";
|
||||
import Server from "../entity/Server";
|
||||
import Setting from "../entity/Setting";
|
||||
import Server from "../database/entities/Server";
|
||||
import Setting from "../database/entities/Setting";
|
||||
|
||||
export default class SettingsHelper {
|
||||
public static async GetSetting(key: string, serverId: string): Promise<string | undefined> {
|
||||
|
|
|
@ -11,6 +11,12 @@ const requiredConfigs: string[] = [
|
|||
"BOT_AUTHOR",
|
||||
"BOT_OWNERID",
|
||||
"BOT_CLIENTID",
|
||||
"DB_HOST",
|
||||
"DB_PORT",
|
||||
"DB_AUTH_USER",
|
||||
"DB_AUTH_PASS",
|
||||
"DB_SYNC",
|
||||
"DB_LOGGING",
|
||||
];
|
||||
|
||||
requiredConfigs.forEach(config => {
|
||||
|
|
Loading…
Reference in a new issue