Esempio n. 1
0
    public async Task <long> GetMemberCountAsync(long chatId)
    {
        var reducedChatId = chatId.ReduceChatId();
        var cacheKey      = $"member-count_{reducedChatId}";

        var getMemberCount = await _cacheService.GetOrSetAsync(
            cacheKey,
            async() => {
            var memberCount = await _botClient.GetChatMemberCountAsync(chatId);

            return(memberCount);
        }
            );

        return(getMemberCount);
    }