This commit is contained in:
rootdarkarchon
2023-10-29 02:30:01 +02:00
parent 2fe312ad67
commit 33afe8da2c
3 changed files with 6 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ public class DiscordBotServices
public ILogger<DiscordBotServices> Logger { get; init; } public ILogger<DiscordBotServices> Logger { get; init; }
public MareMetrics Metrics { get; init; } public MareMetrics Metrics { get; init; }
public ConcurrentQueue<KeyValuePair<ulong, Action<DiscordBotServices>>> VerificationQueue { get; } = new(); public ConcurrentQueue<KeyValuePair<ulong, Func<DiscordBotServices, Task>>> VerificationQueue { get; } = new();
public Task Start() public Task Start()
{ {
@@ -49,7 +49,7 @@ public class DiscordBotServices
{ {
try try
{ {
queueitem.Value.Invoke(this); await queueitem.Value.Invoke(this).ConfigureAwait(false);
Logger.LogInformation("Processed Verification for {key}", queueitem.Key); Logger.LogInformation("Processed Verification for {key}", queueitem.Key);
} }
catch (Exception e) catch (Exception e)

View File

@@ -75,8 +75,8 @@ public partial class MareWizardModule
_logger.LogInformation("{method}:{userId}:{verificationcode}", nameof(ComponentRegisterVerify), Context.Interaction.User.Id, verificationCode); _logger.LogInformation("{method}:{userId}:{verificationcode}", nameof(ComponentRegisterVerify), Context.Interaction.User.Id, verificationCode);
_botServices.VerificationQueue.Enqueue(new KeyValuePair<ulong, Action<DiscordBotServices>>(Context.User.Id, _botServices.VerificationQueue.Enqueue(new KeyValuePair<ulong, Func<DiscordBotServices, Task>>(Context.User.Id,
async (service) => await HandleVerifyAsync(Context.User.Id, verificationCode, service).ConfigureAwait(false))); (service) => HandleVerifyAsync(Context.User.Id, verificationCode, service)));
EmbedBuilder eb = new(); EmbedBuilder eb = new();
ComponentBuilder cb = new(); ComponentBuilder cb = new();
eb.WithColor(Color.Purple); eb.WithColor(Color.Purple);

View File

@@ -70,8 +70,8 @@ public partial class MareWizardModule
_logger.LogInformation("{method}:{userId}:{uid}:{verificationCode}", nameof(ComponentRelinkVerify), Context.Interaction.User.Id, uid, verificationCode); _logger.LogInformation("{method}:{userId}:{uid}:{verificationCode}", nameof(ComponentRelinkVerify), Context.Interaction.User.Id, uid, verificationCode);
_botServices.VerificationQueue.Enqueue(new KeyValuePair<ulong, Action<DiscordBotServices>>(Context.User.Id, _botServices.VerificationQueue.Enqueue(new KeyValuePair<ulong, Func<DiscordBotServices, Task>>(Context.User.Id,
async (services) => await HandleVerifyRelinkAsync(Context.User.Id, verificationCode, services).ConfigureAwait(false))); (services) => HandleVerifyRelinkAsync(Context.User.Id, verificationCode, services)));
EmbedBuilder eb = new(); EmbedBuilder eb = new();
ComponentBuilder cb = new(); ComponentBuilder cb = new();
eb.WithColor(Color.Purple); eb.WithColor(Color.Purple);