Feature/49 ignore channel lists when logging #168

Merged
Vylpes merged 3 commits from feature/49-ignore-channel-lists-when-logging into develop 2022-07-16 16:12:56 +01:00
2 changed files with 34 additions and 0 deletions
Showing only changes of commit 8890b6f4fa - Show all commits

View file

@ -0,0 +1,21 @@
import { Entity, getConnection } from "typeorm";
import BaseEntity from "../contracts/BaseEntity";
@Entity()
export default class IgnoredChannel extends BaseEntity {
constructor(channelId: string) {
super();
this.Id = channelId;
}
public static async IsChannelIgnored(channelId: string): Promise<boolean> {
const connection = getConnection();
const repository = connection.getRepository(IgnoredChannel);
const single = await repository.findOne(channelId);
return single != undefined;
}
}

View file

@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm"
export class migration1657647026816 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
queryRunner.query(`CREATE TABLE ignored_channel (Id varchar(255), PRIMARY KEY (Id))`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
queryRunner.query(`DROP TABLE ignored_channel`)
}
}