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:
parent
8cee4ec1e4
commit
761ff27771
57 changed files with 412 additions and 325 deletions
|
@ -1,9 +1,10 @@
|
|||
import moment from "moment-timezone";
|
||||
import { Brackets, getRepository, Repository } from "typeorm";
|
||||
import { Brackets, Repository } from "typeorm";
|
||||
import { DBDateFormat } from "../utils";
|
||||
import { BaseGuildRepository } from "./BaseGuildRepository";
|
||||
import { Mute } from "./entities/Mute";
|
||||
import { MuteTypes } from "./MuteTypes";
|
||||
import { dataSource } from "./dataSource";
|
||||
import { Mute } from "./entities/Mute";
|
||||
|
||||
export type AddMuteParams = {
|
||||
userId: Mute["user_id"];
|
||||
|
@ -19,7 +20,7 @@ export class GuildMutes extends BaseGuildRepository {
|
|||
|
||||
constructor(guildId) {
|
||||
super(guildId);
|
||||
this.mutes = getRepository(Mute);
|
||||
this.mutes = dataSource.getRepository(Mute);
|
||||
}
|
||||
|
||||
async getExpiredMutes(): Promise<Mute[]> {
|
||||
|
@ -31,7 +32,7 @@ export class GuildMutes extends BaseGuildRepository {
|
|||
.getMany();
|
||||
}
|
||||
|
||||
async findExistingMuteForUserId(userId: string): Promise<Mute | undefined> {
|
||||
async findExistingMuteForUserId(userId: string): Promise<Mute | null> {
|
||||
return this.mutes.findOne({
|
||||
where: {
|
||||
guild_id: this.guildId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue