vylbot-app/src/entity/IgnoredChannel.ts
Ethan Lane c12644d537
Some checks failed
continuous-integration/drone/push Build is failing
Fix build errors from merge
2023-05-08 18:37:51 +01:00

21 lines
576 B
TypeScript

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({ where: { Id: channelId } });
return single != undefined;
}
}