3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 11:07:19 +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,9 +1,10 @@
import moment from "moment-timezone";
import { getRepository, Repository } from "typeorm";
import { Repository } from "typeorm";
import { DAYS, DBDateFormat } from "../utils";
import { BaseRepository } from "./BaseRepository";
import { Mute } from "./entities/Mute";
import { MuteTypes } from "./MuteTypes";
import { dataSource } from "./dataSource";
import { Mute } from "./entities/Mute";
const OLD_EXPIRED_MUTE_THRESHOLD = 7 * DAYS;
@ -16,10 +17,10 @@ export class Mutes extends BaseRepository {
constructor() {
super();
this.mutes = getRepository(Mute);
this.mutes = dataSource.getRepository(Mute);
}
findMute(guildId: string, userId: string): Promise<Mute | undefined> {
findMute(guildId: string, userId: string): Promise<Mute | null> {
return this.mutes.findOne({
where: {
guild_id: guildId,