internal async Task <bool> HasVoted(ulong id, int sinceCycle = 1)
 {
     if (!connected)
     {
         return(true);
     }
     try
     {
         if (sinceCycle <= 1)
         {
             return(await DblApiAuth.HasVoted(id));
         }
         return(await DblApiAuth.HasVoted(id));
     } catch (Exception) { return(true); }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Checks if the user has voted for the bot
 /// </summary>
 /// <param name="id">The ID of the user to check</param>
 /// <returns>True if the user voted, false if not</returns>
 public async Task <bool> CheckUser(ulong id)
 {
     if (AuthAPI == null)
     {
         return(true);
     }
     return(await AuthAPI.HasVoted(id));
 }
Exemplo n.º 3
0
 public async Task HasVotedTestAsync()
 {
     Assert.False(await _api.HasVoted(0));
 }
Exemplo n.º 4
0
 public async Task HasVotedTestAsync()
 {
     Assert.False(!await _dblApi.HasVoted(181514288278536193));
 }