3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

counters: add !counter view command

This commit is contained in:
Dragory 2021-02-13 22:08:38 +02:00
parent 78ff2641d4
commit 91fde47c97
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
4 changed files with 153 additions and 1 deletions

View file

@ -477,4 +477,20 @@ export class GuildCounters extends BaseGuildRepository {
}));
});
}
async getCurrentValue(
counterId: number,
channelId: string | null,
userId: string | null,
): Promise<number | undefined> {
const value = await this.counterValues.findOne({
where: {
counter_id: counterId,
channel_id: channelId || "0",
user_id: userId || "0",
},
});
return value?.value;
}
}