- Updated editorconfig rules to hopefully look a bit nicer.

- Removed configureawait(false) from everywhere as it doesnt' do anything in a console app and just makes the code look ugly
- Started using .WhenAll extension instead of Task.WhenAll to make it look nicer when chaining methods
This commit is contained in:
Kwoth
2021-12-28 21:14:26 +01:00
parent d093f7eed7
commit 723447c7d4
171 changed files with 1523 additions and 1594 deletions

View File

@@ -1,4 +1,4 @@
#nullable disable
#nullable disable
using NadekoBot.Services.Database.Models;
namespace NadekoBot.Modules.Gambling.Common.Events;
@@ -74,14 +74,14 @@ public class ReactionEvent : ICurrencyEvent
await _cs.AddBulkAsync(toAward,
toAward.Select(x => "Reaction Event"),
toAward.Select(x => _amount),
gamble: true).ConfigureAwait(false);
gamble: true);
if (_isPotLimited)
{
await _msg.ModifyAsync(m =>
{
m.Embed = GetEmbed(PotSize).Build();
}, new() { RetryMode = RetryMode.AlwaysRetry }).ConfigureAwait(false);
}, new() { RetryMode = RetryMode.AlwaysRetry });
}
Log.Information("Awarded {0} users {1} currency.{2}",
@@ -110,8 +110,8 @@ public class ReactionEvent : ICurrencyEvent
{
_emote = new Emoji(_config.Currency.Sign);
}
_msg = await _channel.EmbedAsync(GetEmbed(_opts.PotSize)).ConfigureAwait(false);
await _msg.AddReactionAsync(_emote).ConfigureAwait(false);
_msg = await _channel.EmbedAsync(GetEmbed(_opts.PotSize));
await _msg.AddReactionAsync(_emote);
_client.MessageDeleted += OnMessageDeleted;
_client.ReactionAdded += HandleReaction;
_t.Change(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(2));
@@ -124,7 +124,7 @@ public class ReactionEvent : ICurrencyEvent
{
if (msg.Id == _msg.Id)
{
await StopEvent().ConfigureAwait(false);
await StopEvent();
}
}