ModActions: add !cases cmd without user, tweak old !cases response message

This commit is contained in:
Dragory 2019-02-23 21:33:57 +02:00
parent 0c974e1d16
commit 147dcc973d
2 changed files with 35 additions and 2 deletions

View file

@ -70,6 +70,20 @@ export class GuildCases extends BaseRepository {
});
}
async getRecent(count: number): Promise<Case[]> {
return this.cases.find({
relations: this.getRelations(),
where: {
guild_id: this.guildId,
is_hidden: 0,
},
take: count,
order: {
case_number: "DESC",
},
});
}
async setHidden(id: number, hidden: boolean): Promise<void> {
await this.cases.update(
{ id },