3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 08:45:03 +00:00

counters: add !counter view command

This commit is contained in:
Dragory 2021-02-13 22:08:38 +02:00
parent 2a3145e97b
commit 464bc86102
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;
}
}