add more logging to mare wizard module
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using Discord.Rest;
|
using Discord.Rest;
|
||||||
using Discord.WebSocket;
|
|
||||||
using MareSynchronosShared.Metrics;
|
using MareSynchronosShared.Metrics;
|
||||||
|
|
||||||
namespace MareSynchronosServices.Discord;
|
namespace MareSynchronosServices.Discord;
|
||||||
@@ -46,13 +45,12 @@ public class DiscordBotServices
|
|||||||
verificationTaskCts = new CancellationTokenSource();
|
verificationTaskCts = new CancellationTokenSource();
|
||||||
while (!verificationTaskCts.IsCancellationRequested)
|
while (!verificationTaskCts.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
|
Logger.LogInformation("Processing Verification Queue, Entries: {entr}", VerificationQueue.Count);
|
||||||
if (VerificationQueue.TryDequeue(out var queueitem))
|
if (VerificationQueue.TryDequeue(out var queueitem))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
queueitem.Value.Invoke(_serviceProvider);
|
queueitem.Value.Invoke(_serviceProvider);
|
||||||
|
|
||||||
Logger.LogInformation("Sent login information to user");
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentDelete), Context.Interaction.User.Id);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithTitle("Delete Account");
|
eb.WithTitle("Delete Account");
|
||||||
@@ -33,6 +35,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(SelectionDeleteAccount), Context.Interaction.User.Id, uid);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
bool isPrimary = mareDb.Auth.Single(u => u.UserUID == uid).PrimaryUserUID == null;
|
bool isPrimary = mareDb.Auth.Single(u => u.UserUID == uid).PrimaryUserUID == null;
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
@@ -53,6 +57,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(ComponentDeleteAccountConfirm), Context.Interaction.User.Id, uid);
|
||||||
|
|
||||||
await RespondWithModalAsync<ConfirmDeletionModal>("wizard-delete-confirm-modal:" + uid).ConfigureAwait(false);
|
await RespondWithModalAsync<ConfirmDeletionModal>("wizard-delete-confirm-modal:" + uid).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,6 +67,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(ModalDeleteAccountConfirm), Context.Interaction.User.Id, uid);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!string.Equals("DELETE", modal.Delete, StringComparison.Ordinal))
|
if (!string.Equals("DELETE", modal.Delete, StringComparison.Ordinal))
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentRecover), Context.Interaction.User.Id);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithColor(Color.Blue);
|
eb.WithColor(Color.Blue);
|
||||||
@@ -34,6 +36,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(SelectionRecovery), Context.Interaction.User.Id, uid);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithColor(Color.Green);
|
eb.WithColor(Color.Green);
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentRegister), Context.Interaction.User.Id);
|
||||||
|
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithColor(Color.Blue);
|
eb.WithColor(Color.Blue);
|
||||||
eb.WithTitle("Start Registration");
|
eb.WithTitle("Start Registration");
|
||||||
@@ -33,6 +35,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentRegisterStart), Context.Interaction.User.Id);
|
||||||
|
|
||||||
using var db = GetDbContext();
|
using var db = GetDbContext();
|
||||||
var entry = await db.LodeStoneAuth.SingleOrDefaultAsync(u => u.DiscordId == Context.User.Id && u.StartedAt != null).ConfigureAwait(false);
|
var entry = await db.LodeStoneAuth.SingleOrDefaultAsync(u => u.DiscordId == Context.User.Id && u.StartedAt != null).ConfigureAwait(false);
|
||||||
if (entry != null)
|
if (entry != null)
|
||||||
@@ -52,6 +56,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{lodestone}", nameof(ModalRegister), Context.Interaction.User.Id, lodestoneModal.LodestoneUrl);
|
||||||
|
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithColor(Color.Purple);
|
eb.WithColor(Color.Purple);
|
||||||
var success = await HandleRegisterModalAsync(eb, lodestoneModal).ConfigureAwait(false);
|
var success = await HandleRegisterModalAsync(eb, lodestoneModal).ConfigureAwait(false);
|
||||||
@@ -67,6 +73,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{verificationcode}", nameof(ComponentRegisterVerify), Context.Interaction.User.Id, verificationCode);
|
||||||
|
|
||||||
_botServices.VerificationQueue.Enqueue(new KeyValuePair<ulong, Action<IServiceProvider>>(Context.User.Id,
|
_botServices.VerificationQueue.Enqueue(new KeyValuePair<ulong, Action<IServiceProvider>>(Context.User.Id,
|
||||||
async (_) => await HandleVerifyAsync(Context.User.Id, verificationCode).ConfigureAwait(false)));
|
async (_) => await HandleVerifyAsync(Context.User.Id, verificationCode).ConfigureAwait(false)));
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
@@ -86,6 +94,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(ComponentRegisterVerify), Context.Interaction.User.Id, verificationCode);
|
||||||
|
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
ComponentBuilder cb = new();
|
ComponentBuilder cb = new();
|
||||||
bool stillEnqueued = _botServices.VerificationQueue.Any(k => k.Key == Context.User.Id);
|
bool stillEnqueued = _botServices.VerificationQueue.Any(k => k.Key == Context.User.Id);
|
||||||
@@ -202,20 +212,28 @@ public partial class MareWizardModule
|
|||||||
if (_botServices.DiscordLodestoneMapping.ContainsKey(userid))
|
if (_botServices.DiscordLodestoneMapping.ContainsKey(userid))
|
||||||
{
|
{
|
||||||
var randomServer = _botServices.LodestoneServers[random.Next(_botServices.LodestoneServers.Length)];
|
var randomServer = _botServices.LodestoneServers[random.Next(_botServices.LodestoneServers.Length)];
|
||||||
var response = await req.GetAsync($"https://{randomServer}.finalfantasyxiv.com/lodestone/character/{_botServices.DiscordLodestoneMapping[userid]}").ConfigureAwait(false);
|
var url = $"https://{randomServer}.finalfantasyxiv.com/lodestone/character/{_botServices.DiscordLodestoneMapping[userid]}";
|
||||||
|
var response = await req.GetAsync(url).ConfigureAwait(false);
|
||||||
|
_logger.LogInformation("Verifying {userid} with URL {url}", userid, url);
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
|
var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||||
if (content.Contains(authString))
|
if (content.Contains(authString))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("Verified {userid} from lodestone {lodestone}", userid, _botServices.DiscordLodestoneMapping[userid]);
|
||||||
_botServices.DiscordVerifiedUsers[userid] = true;
|
_botServices.DiscordVerifiedUsers[userid] = true;
|
||||||
_botServices.DiscordLodestoneMapping.TryRemove(userid, out _);
|
_botServices.DiscordLodestoneMapping.TryRemove(userid, out _);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("Could not verify {userid} from lodestone {lodestone}, did not find authString: {authString}", userid, _botServices.DiscordLodestoneMapping[userid], authString);
|
||||||
_botServices.DiscordVerifiedUsers[userid] = false;
|
_botServices.DiscordVerifiedUsers[userid] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Could not verify {userid}, HttpStatusCode: {code}", userid, response.StatusCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentRelink), Context.Interaction.User.Id);
|
||||||
|
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithTitle("Relink");
|
eb.WithTitle("Relink");
|
||||||
eb.WithColor(Color.Blue);
|
eb.WithColor(Color.Blue);
|
||||||
@@ -32,6 +34,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentRelinkStart), Context.Interaction.User.Id);
|
||||||
|
|
||||||
using var db = GetDbContext();
|
using var db = GetDbContext();
|
||||||
db.LodeStoneAuth.RemoveRange(db.LodeStoneAuth.Where(u => u.DiscordId == Context.User.Id));
|
db.LodeStoneAuth.RemoveRange(db.LodeStoneAuth.Where(u => u.DiscordId == Context.User.Id));
|
||||||
_botServices.DiscordVerifiedUsers.TryRemove(Context.User.Id, out _);
|
_botServices.DiscordVerifiedUsers.TryRemove(Context.User.Id, out _);
|
||||||
@@ -46,6 +50,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{url}", nameof(ModalRelink), Context.Interaction.User.Id, lodestoneModal.LodestoneUrl);
|
||||||
|
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithColor(Color.Purple);
|
eb.WithColor(Color.Purple);
|
||||||
var result = await HandleRelinkModalAsync(eb, lodestoneModal).ConfigureAwait(false);
|
var result = await HandleRelinkModalAsync(eb, lodestoneModal).ConfigureAwait(false);
|
||||||
@@ -61,6 +67,9 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}:{verificationCode}", nameof(ComponentRelinkVerify), Context.Interaction.User.Id, uid, verificationCode);
|
||||||
|
|
||||||
|
|
||||||
_botServices.VerificationQueue.Enqueue(new KeyValuePair<ulong, Action<IServiceProvider>>(Context.User.Id,
|
_botServices.VerificationQueue.Enqueue(new KeyValuePair<ulong, Action<IServiceProvider>>(Context.User.Id,
|
||||||
async (_) => await HandleVerifyRelinkAsync(Context.User.Id, verificationCode).ConfigureAwait(false)));
|
async (_) => await HandleVerifyRelinkAsync(Context.User.Id, verificationCode).ConfigureAwait(false)));
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
@@ -80,6 +89,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}:{verificationCode}", nameof(ComponentRelinkVerifyCheck), Context.Interaction.User.Id, uid, verificationCode);
|
||||||
|
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
ComponentBuilder cb = new();
|
ComponentBuilder cb = new();
|
||||||
bool stillEnqueued = _botServices.VerificationQueue.Any(k => k.Key == Context.User.Id);
|
bool stillEnqueued = _botServices.VerificationQueue.Any(k => k.Key == Context.User.Id);
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentSecondary), Context.Interaction.User.Id);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
var primaryUID = (await mareDb.LodeStoneAuth.Include(u => u.User).SingleAsync(u => u.DiscordId == Context.User.Id).ConfigureAwait(false)).User.UID;
|
var primaryUID = (await mareDb.LodeStoneAuth.Include(u => u.User).SingleAsync(u => u.DiscordId == Context.User.Id).ConfigureAwait(false)).User.UID;
|
||||||
var secondaryUids = await mareDb.Auth.CountAsync(p => p.PrimaryUserUID == primaryUID).ConfigureAwait(false);
|
var secondaryUids = await mareDb.Auth.CountAsync(p => p.PrimaryUserUID == primaryUID).ConfigureAwait(false);
|
||||||
@@ -36,6 +38,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{primary}", nameof(ComponentSecondaryCreate), Context.Interaction.User.Id, primaryUid);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithTitle("Secondary UID created");
|
eb.WithTitle("Secondary UID created");
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentUserinfo), Context.Interaction.User.Id);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithTitle("User Info");
|
eb.WithTitle("User Info");
|
||||||
@@ -32,6 +34,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(SelectionUserinfo), Context.Interaction.User.Id, uid);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
eb.WithTitle($"User Info for {uid}");
|
eb.WithTitle($"User Info for {uid}");
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(ComponentVanity), Context.Interaction.User.Id);
|
||||||
|
|
||||||
StringBuilder sb = new();
|
StringBuilder sb = new();
|
||||||
var user = await Context.Guild.GetUserAsync(Context.User.Id).ConfigureAwait(false);
|
var user = await Context.Guild.GetUserAsync(Context.User.Id).ConfigureAwait(false);
|
||||||
bool userIsInVanityRole = _botServices.VanityRoles.Exists(u => user.RoleIds.Contains(u.Id)) || !_botServices.VanityRoles.Any();
|
bool userIsInVanityRole = _botServices.VanityRoles.Exists(u => user.RoleIds.Contains(u.Id)) || !_botServices.VanityRoles.Any();
|
||||||
@@ -52,6 +54,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(SelectionVanityUid), Context.Interaction.User.Id, uid);
|
||||||
|
|
||||||
using var db = GetDbContext();
|
using var db = GetDbContext();
|
||||||
var user = db.Users.Single(u => u.UID == uid);
|
var user = db.Users.Single(u => u.UID == uid);
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
@@ -71,6 +75,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(SelectionVanityUidSet), Context.Interaction.User.Id, uid);
|
||||||
|
|
||||||
await RespondWithModalAsync<VanityUidModal>("wizard-vanity-uid-modal:" + uid).ConfigureAwait(false);
|
await RespondWithModalAsync<VanityUidModal>("wizard-vanity-uid-modal:" + uid).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +85,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}:{vanity}", nameof(ConfirmVanityUidModal), Context.Interaction.User.Id, uid, modal.DesiredVanityUID);
|
||||||
|
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
ComponentBuilder cb = new();
|
ComponentBuilder cb = new();
|
||||||
var desiredVanityUid = modal.DesiredVanityUID;
|
var desiredVanityUid = modal.DesiredVanityUID;
|
||||||
@@ -121,6 +129,8 @@ public partial class MareWizardModule
|
|||||||
[ComponentInteraction("wizard-vanity-gid")]
|
[ComponentInteraction("wizard-vanity-gid")]
|
||||||
public async Task SelectionVanityGid(string gid)
|
public async Task SelectionVanityGid(string gid)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("{method}:{userId}:{uid}", nameof(SelectionVanityGid), Context.Interaction.User.Id, gid);
|
||||||
|
|
||||||
using var db = GetDbContext();
|
using var db = GetDbContext();
|
||||||
var group = db.Groups.Single(u => u.GID == gid);
|
var group = db.Groups.Single(u => u.GID == gid);
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
@@ -140,6 +150,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{gid}", nameof(SelectionVanityGidSet), Context.Interaction.User.Id, gid);
|
||||||
|
|
||||||
await RespondWithModalAsync<VanityGidModal>("wizard-vanity-gid-modal:" + gid).ConfigureAwait(false);
|
await RespondWithModalAsync<VanityGidModal>("wizard-vanity-gid-modal:" + gid).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +160,8 @@ public partial class MareWizardModule
|
|||||||
{
|
{
|
||||||
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}:{gid}:{vanity}", nameof(ConfirmVanityGidModal), Context.Interaction.User.Id, gid, modal.DesiredVanityGID);
|
||||||
|
|
||||||
EmbedBuilder eb = new();
|
EmbedBuilder eb = new();
|
||||||
ComponentBuilder cb = new();
|
ComponentBuilder cb = new();
|
||||||
var desiredVanityUid = modal.DesiredVanityGID;
|
var desiredVanityUid = modal.DesiredVanityGID;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using MareSynchronosShared.Models;
|
|||||||
using MareSynchronosShared.Services;
|
using MareSynchronosShared.Services;
|
||||||
using MareSynchronosShared.Utils;
|
using MareSynchronosShared.Utils;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Win32;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
@@ -40,6 +41,8 @@ public partial class MareWizardModule : InteractionModuleBase
|
|||||||
{
|
{
|
||||||
if (!init && !(await ValidateInteraction().ConfigureAwait(false))) return;
|
if (!init && !(await ValidateInteraction().ConfigureAwait(false))) return;
|
||||||
|
|
||||||
|
_logger.LogInformation("{method}:{userId}", nameof(StartWizard), Context.Interaction.User.Id);
|
||||||
|
|
||||||
using var mareDb = GetDbContext();
|
using var mareDb = GetDbContext();
|
||||||
bool hasAccount = await mareDb.LodeStoneAuth.AnyAsync(u => u.DiscordId == Context.User.Id && u.StartedAt == null).ConfigureAwait(false);
|
bool hasAccount = await mareDb.LodeStoneAuth.AnyAsync(u => u.DiscordId == Context.User.Id && u.StartedAt == null).ConfigureAwait(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user