mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 02:25:01 +00:00
initial - tempbans & mutes
This commit is contained in:
parent
c84d1a0be1
commit
744b9273bb
14 changed files with 322 additions and 109 deletions
|
@ -11,6 +11,14 @@ export class GuildMutes extends BaseGuildRepository {
|
|||
this.mutes = getRepository(Mute);
|
||||
}
|
||||
|
||||
async getAllTemporaryMutes(): Promise<Mute[]> {
|
||||
return this.mutes
|
||||
.createQueryBuilder("mutes")
|
||||
.where("guild_id = :guild_id", { guild_id: this.guildId })
|
||||
.andWhere("expires_at IS NOT NULL")
|
||||
.getMany();
|
||||
}
|
||||
|
||||
async getExpiredMutes(): Promise<Mute[]> {
|
||||
return this.mutes
|
||||
.createQueryBuilder("mutes")
|
||||
|
|
|
@ -11,9 +11,17 @@ export class GuildTempbans extends BaseGuildRepository {
|
|||
this.tempbans = getRepository(Tempban);
|
||||
}
|
||||
|
||||
async getAllTempbans(): Promise<Tempban[]> {
|
||||
return this.tempbans
|
||||
.createQueryBuilder("tempbans")
|
||||
.where("guild_id = :guild_id", { guild_id: this.guildId })
|
||||
.andWhere("expires_at IS NOT NULL")
|
||||
.getMany();
|
||||
}
|
||||
|
||||
async getExpiredTempbans(): Promise<Tempban[]> {
|
||||
return this.tempbans
|
||||
.createQueryBuilder("mutes")
|
||||
.createQueryBuilder("tempbans")
|
||||
.where("guild_id = :guild_id", { guild_id: this.guildId })
|
||||
.andWhere("expires_at IS NOT NULL")
|
||||
.andWhere("expires_at <= NOW()")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue