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:
parent
4621cec9d5
commit
a01a43788e
5 changed files with 83 additions and 3 deletions
21
src/entity/IgnoredChannel.ts
Normal file
21
src/entity/IgnoredChannel.ts
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue