vylbot-app/src/entity/IgnoredChannel.ts

21 lines
576 B
TypeScript
Raw Normal View History

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);
2023-05-08 18:37:51 +01:00
const single = await repository.findOne({ where: { Id: channelId } });
return single != undefined;
}
}