3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 04:25:01 +00:00

feat: upgrade to TypeORM 0.3

This commit is contained in:
Dragory 2023-07-01 12:17:45 +00:00
parent 8cee4ec1e4
commit 761ff27771
No known key found for this signature in database
57 changed files with 412 additions and 325 deletions

View file

@ -1,5 +1,6 @@
import { getRepository, Repository } from "typeorm";
import { Repository } from "typeorm";
import { BaseGuildRepository } from "./BaseGuildRepository";
import { dataSource } from "./dataSource";
import { AutoReaction } from "./entities/AutoReaction";
export class GuildAutoReactions extends BaseGuildRepository {
@ -7,7 +8,7 @@ export class GuildAutoReactions extends BaseGuildRepository {
constructor(guildId) {
super(guildId);
this.autoReactions = getRepository(AutoReaction);
this.autoReactions = dataSource.getRepository(AutoReaction);
}
async all(): Promise<AutoReaction[]> {
@ -18,7 +19,7 @@ export class GuildAutoReactions extends BaseGuildRepository {
});
}
async getForChannel(channelId: string): Promise<AutoReaction | undefined> {
async getForChannel(channelId: string): Promise<AutoReaction | null> {
return this.autoReactions.findOne({
where: {
guild_id: this.guildId,