Feature/49 ignore channel lists when logging (#168)

* Add entity

* Create ignore command

* Update message events to ignore channels set
This commit is contained in:
Vylpes 2022-07-16 16:12:55 +01:00 committed by GitHub
parent 4621cec9d5
commit a01a43788e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 83 additions and 3 deletions

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;
}
}