Exemple #1
0
 public static async Task <bool> GetBoolAsync(this IGuildOptionRepository repository, ulong guildId, string key, bool defaultValue = false)
 {
     return(bool.TryParse(await repository.GetAsync(guildId, key), out var value) ? value : defaultValue);
 }
Exemple #2
0
 public static async Task <ulong> GetUInt64Async(this IGuildOptionRepository repository, ulong guildId, string key, ulong defaultValue = 0)
 {
     return(ulong.TryParse(await repository.GetAsync(guildId, key), out var value) ? value : defaultValue);
 }
Exemple #3
0
 public static async ValueTask <int> GetInt32Async(this IGuildOptionRepository repository, ulong guildId, string key, int defaultValue = 0)
 {
     return(int.TryParse(await repository.GetAsync(guildId, key), out var value) ? value : defaultValue);
 }