Compare commits
No commits in common. "818c527ab25d3ec71256c2cce8f934f7baf2a646" and "9ebc8a8991410731399d910af7d733aaba35e895" have entirely different histories.
818c527ab2
...
9ebc8a8991
31 changed files with 55 additions and 77 deletions
24
.stage.env
24
.stage.env
|
@ -1,24 +0,0 @@
|
||||||
# Security Warning! Do not commit this file to any VCS!
|
|
||||||
# This is a local file to speed up development process,
|
|
||||||
# so you don't have to change your environment variables.
|
|
||||||
#
|
|
||||||
# This is not applied to `.env.template`!
|
|
||||||
# Template files must be committed to the VCS, but must not contain
|
|
||||||
# any secret values.
|
|
||||||
|
|
||||||
BOT_TOKEN=
|
|
||||||
BOT_VER=3.1
|
|
||||||
BOT_AUTHOR=Vylpes
|
|
||||||
BOT_OWNERID=147392775707426816
|
|
||||||
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
|
|
|
@ -9,8 +9,8 @@
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"start": "node ./dist/vylbot",
|
"start": "node ./dist/vylbot",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"db:up": "typeorm migration:run -d dist/database/dataSources/appDataSource.js",
|
"db:up": "typeorm migration:run",
|
||||||
"db:down": "typeorm migration:revert -d dist/database/dataSources/appDataSource.js"
|
"db:down": "typeorm migration:revert"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -13,6 +13,7 @@ cd ~/apps/vylbot/vylbot_prod \
|
||||||
&& (pm2 stop vylbot_prod || true) \
|
&& (pm2 stop vylbot_prod || true) \
|
||||||
&& (pm2 delete vylbot_prod || true) \
|
&& (pm2 delete vylbot_prod || true) \
|
||||||
&& cp .prod.env .env \
|
&& cp .prod.env .env \
|
||||||
|
&& cp ormconfig.prod.json ormconfig.json \
|
||||||
&& yarn clean \
|
&& yarn clean \
|
||||||
&& yarn install --frozen-lockfile \
|
&& yarn install --frozen-lockfile \
|
||||||
&& yarn build \
|
&& yarn build \
|
||||||
|
|
|
@ -13,6 +13,7 @@ cd ~/apps/vylbot/vylbot_stage \
|
||||||
&& (pm2 stop vylbot_stage || true) \
|
&& (pm2 stop vylbot_stage || true) \
|
||||||
&& (pm2 delete vylbot_stage || true) \
|
&& (pm2 delete vylbot_stage || true) \
|
||||||
&& cp .stage.env .env \
|
&& cp .stage.env .env \
|
||||||
|
&& cp ormconfig.stage.json ormconfig.json \
|
||||||
&& yarn clean \
|
&& yarn clean \
|
||||||
&& yarn install --frozen-lockfile \
|
&& yarn install --frozen-lockfile \
|
||||||
&& yarn build \
|
&& yarn build \
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Command } from "../type/command";
|
||||||
|
|
||||||
import { Events } from "./events";
|
import { Events } from "./events";
|
||||||
import { Util } from "./util";
|
import { Util } from "./util";
|
||||||
import AppDataSource from "../database/dataSources/appDataSource";
|
import AppDataSource from "../database/appDataSource";
|
||||||
|
|
||||||
export class CoreClient extends Client {
|
export class CoreClient extends Client {
|
||||||
private static _commandItems: ICommandItem[];
|
private static _commandItems: ICommandItem[];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import { Command } from "../../../type/command";
|
import { Command } from "../../../type/command";
|
||||||
import { default as eLobby } from "../../../database/entities/501231711271780357/Lobby";
|
import { default as eLobby } from "../../../entity/501231711271780357/Lobby";
|
||||||
|
|
||||||
export default class AddRole extends Command {
|
export default class AddRole extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { CacheType, CommandInteraction, EmbedBuilder, GuildBasedChannel, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
import { CacheType, CommandInteraction, EmbedBuilder, GuildBasedChannel, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import { Command } from "../../../type/command";
|
import { Command } from "../../../type/command";
|
||||||
import { default as eLobby } from "../../../database/entities/501231711271780357/Lobby";
|
import { default as eLobby } from "../../../entity/501231711271780357/Lobby";
|
||||||
import EmbedColours from "../../../constants/EmbedColours";
|
import EmbedColours from "../../../constants/EmbedColours";
|
||||||
|
|
||||||
export default class ListLobby extends Command {
|
export default class ListLobby extends Command {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { Command } from "../../../type/command";
|
import { Command } from "../../../type/command";
|
||||||
import { default as eLobby } from "../../../database/entities/501231711271780357/Lobby";
|
import { default as eLobby } from "../../../entity/501231711271780357/Lobby";
|
||||||
|
|
||||||
export default class Lobby extends Command {
|
export default class Lobby extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import { Command } from "../../../type/command";
|
import { Command } from "../../../type/command";
|
||||||
import { default as eLobby } from "../../../database/entities/501231711271780357/Lobby";
|
import { default as eLobby } from "../../../entity/501231711271780357/Lobby";
|
||||||
import BaseEntity from "../../../contracts/BaseEntity";
|
import BaseEntity from "../../../contracts/BaseEntity";
|
||||||
|
|
||||||
export default class RemoveLobby extends Command {
|
export default class RemoveLobby extends Command {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import { Command } from "../../type/command";
|
import { Command } from "../../type/command";
|
||||||
import { default as eRole } from "../../database/entities/Role";
|
import { default as eRole } from "../../entity/Role";
|
||||||
import Server from "../../database/entities/Server";
|
import Server from "../../entity/Server";
|
||||||
|
|
||||||
export default class ConfigRole extends Command {
|
export default class ConfigRole extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { CommandInteraction, EmbedBuilder, GuildMemberRoleManager, SlashCommandBuilder } from "discord.js";
|
import { CommandInteraction, EmbedBuilder, GuildMemberRoleManager, SlashCommandBuilder } from "discord.js";
|
||||||
import { Command } from "../../type/command";
|
import { Command } from "../../type/command";
|
||||||
import { default as eRole } from "../../database/entities/Role";
|
import { default as eRole } from "../../entity/Role";
|
||||||
import EmbedColours from "../../constants/EmbedColours";
|
import EmbedColours from "../../constants/EmbedColours";
|
||||||
|
|
||||||
export default class Role extends Command {
|
export default class Role extends Command {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import Audit from "../database/entities/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 { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Command } from "../type/command";
|
import { Command } from "../type/command";
|
||||||
import Audit from "../database/entities/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";
|
||||||
import EmbedColours from "../constants/EmbedColours";
|
import EmbedColours from "../constants/EmbedColours";
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuil
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
import DefaultValues from "../constants/DefaultValues";
|
import DefaultValues from "../constants/DefaultValues";
|
||||||
import EmbedColours from "../constants/EmbedColours";
|
import EmbedColours from "../constants/EmbedColours";
|
||||||
import Server from "../database/entities/Server";
|
import Server from "../entity/Server";
|
||||||
import Setting from "../database/entities/Setting";
|
import Setting from "../entity/Setting";
|
||||||
import { Command } from "../type/command";
|
import { Command } from "../type/command";
|
||||||
|
|
||||||
export default class Config extends Command {
|
export default class Config extends Command {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import IgnoredChannel from "../database/entities/IgnoredChannel";
|
import IgnoredChannel from "../entity/IgnoredChannel";
|
||||||
import { Command } from "../type/command";
|
import { Command } from "../type/command";
|
||||||
|
|
||||||
export default class Ignore extends Command {
|
export default class Ignore extends Command {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Command } from "../type/command";
|
import { Command } from "../type/command";
|
||||||
import Audit from "../database/entities/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";
|
||||||
import EmbedColours from "../constants/EmbedColours";
|
import EmbedColours from "../constants/EmbedColours";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
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 Audit from "../database/entities/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";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
import { CommandInteraction, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import Server from "../database/entities/Server";
|
import Server from "../entity/Server";
|
||||||
import { Command } from "../type/command";
|
import { Command } from "../type/command";
|
||||||
|
|
||||||
export default class Setup extends Command {
|
export default class Setup extends Command {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
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 Audit from "../database/entities/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";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Column, DeepPartial, EntityTarget, PrimaryColumn, ObjectLiteral, FindOptionsWhere } from "typeorm";
|
import { Column, DeepPartial, EntityTarget, PrimaryColumn, ObjectLiteral, FindOptionsWhere } from "typeorm";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
import AppDataSource from "../database/dataSources/appDataSource";
|
import AppDataSource from "../database/appDataSource";
|
||||||
|
|
||||||
export default class BaseEntity {
|
export default class BaseEntity {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -13,13 +13,13 @@ const AppDataSource = new DataSource({
|
||||||
synchronize: process.env.DB_SYNC == "true",
|
synchronize: process.env.DB_SYNC == "true",
|
||||||
logging: process.env.DB_LOGGING == "true",
|
logging: process.env.DB_LOGGING == "true",
|
||||||
entities: [
|
entities: [
|
||||||
"dist/database/entities/**/*.js",
|
"dist/entity/**/*.js",
|
||||||
],
|
],
|
||||||
migrations: [
|
migrations: [
|
||||||
"dist/database/migrations/**/*.js",
|
"dist/mirgration/**/*.js",
|
||||||
],
|
],
|
||||||
subscribers: [
|
subscribers: [
|
||||||
"dist/database/subscribers/**/*.js",
|
"dist/subscriber/**/*.js",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Column, Entity } from "typeorm";
|
import { Column, Entity } from "typeorm";
|
||||||
import BaseEntity from "../../../contracts/BaseEntity";
|
import BaseEntity from "../../contracts/BaseEntity";
|
||||||
import AppDataSource from "../../dataSources/appDataSource";
|
import AppDataSource from "../../database/appDataSource";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export default class Lobby extends BaseEntity {
|
export default class Lobby extends BaseEntity {
|
|
@ -1,8 +1,8 @@
|
||||||
import { Column, Entity } from "typeorm";
|
import { Column, Entity } 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";
|
||||||
import AppDataSource from "../dataSources/appDataSource";
|
import AppDataSource from "../database/appDataSource";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export default class Audit extends BaseEntity {
|
export default class Audit extends BaseEntity {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Entity } from "typeorm";
|
import { Entity } from "typeorm";
|
||||||
import BaseEntity from "../../contracts/BaseEntity";
|
import BaseEntity from "../contracts/BaseEntity";
|
||||||
import AppDataSource from "../dataSources/appDataSource";
|
import AppDataSource from "../database/appDataSource";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export default class IgnoredChannel extends BaseEntity {
|
export default class IgnoredChannel extends BaseEntity {
|
|
@ -1,7 +1,7 @@
|
||||||
import { Column, Entity, ManyToOne } from "typeorm";
|
import { Column, Entity, ManyToOne } from "typeorm";
|
||||||
import BaseEntity from "../../contracts/BaseEntity"
|
import BaseEntity from "../contracts/BaseEntity"
|
||||||
import Server from "./Server";
|
import Server from "./Server";
|
||||||
import AppDataSource from "../dataSources/appDataSource";
|
import AppDataSource from "../database/appDataSource";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export default class Role extends BaseEntity {
|
export default class Role extends BaseEntity {
|
|
@ -1,5 +1,5 @@
|
||||||
import { Entity, OneToMany } from "typeorm";
|
import { Entity, OneToMany } from "typeorm";
|
||||||
import BaseEntity from "../../contracts/BaseEntity";
|
import BaseEntity from "../contracts/BaseEntity";
|
||||||
import Role from "./Role";
|
import Role from "./Role";
|
||||||
import Setting from "./Setting";
|
import Setting from "./Setting";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Column, Entity, ManyToOne } from "typeorm";
|
import { Column, Entity, ManyToOne } from "typeorm";
|
||||||
import BaseEntity from "../../contracts/BaseEntity";
|
import BaseEntity from "../contracts/BaseEntity";
|
||||||
import Server from "./Server";
|
import Server from "./Server";
|
||||||
import AppDataSource from "../dataSources/appDataSource";
|
import AppDataSource from "../database/appDataSource";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export default class Setting extends BaseEntity {
|
export default class Setting extends BaseEntity {
|
|
@ -1,6 +1,6 @@
|
||||||
import { EmbedBuilder, Message, TextChannel } from "discord.js";
|
import { EmbedBuilder, Message, TextChannel } from "discord.js";
|
||||||
import EmbedColours from "../../constants/EmbedColours";
|
import EmbedColours from "../../constants/EmbedColours";
|
||||||
import IgnoredChannel from "../../database/entities/IgnoredChannel";
|
import IgnoredChannel from "../../entity/IgnoredChannel";
|
||||||
import SettingsHelper from "../../helpers/SettingsHelper";
|
import SettingsHelper from "../../helpers/SettingsHelper";
|
||||||
|
|
||||||
export default async function MessageDelete(message: Message) {
|
export default async function MessageDelete(message: Message) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { EmbedBuilder, Message, TextChannel } from "discord.js";
|
import { EmbedBuilder, Message, TextChannel } from "discord.js";
|
||||||
import EmbedColours from "../../constants/EmbedColours";
|
import EmbedColours from "../../constants/EmbedColours";
|
||||||
import IgnoredChannel from "../../database/entities/IgnoredChannel";
|
import IgnoredChannel from "../../entity/IgnoredChannel";
|
||||||
import SettingsHelper from "../../helpers/SettingsHelper";
|
import SettingsHelper from "../../helpers/SettingsHelper";
|
||||||
|
|
||||||
export default async function MessageUpdate(oldMessage: Message, newMessage: Message) {
|
export default async function MessageUpdate(oldMessage: Message, newMessage: Message) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import DefaultValues from "../constants/DefaultValues";
|
import DefaultValues from "../constants/DefaultValues";
|
||||||
import Server from "../database/entities/Server";
|
import Server from "../entity/Server";
|
||||||
import Setting from "../database/entities/Setting";
|
import Setting from "../entity/Setting";
|
||||||
|
|
||||||
export default class SettingsHelper {
|
export default class SettingsHelper {
|
||||||
public static async GetSetting(key: string, serverId: string): Promise<string | undefined> {
|
public static async GetSetting(key: string, serverId: string): Promise<string | undefined> {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { MigrationInterface, QueryRunner } from "typeorm"
|
import { MigrationInterface, QueryRunner } from "typeorm"
|
||||||
import MigrationHelper from "../../../helpers/MigrationHelper"
|
import MigrationHelper from "../../helpers/MigrationHelper"
|
||||||
|
|
||||||
export class vylbot1662399171315 implements MigrationInterface {
|
export class vylbot1662399171315 implements MigrationInterface {
|
||||||
|
|
Loading…
Reference in a new issue