add more logging to mare wizard module

This commit is contained in:
rootdarkarchon 2023-10-12 17:11:39 +02:00
parent fee84aa1ff
commit 2f1b1f4b27
9 changed files with 68 additions and 4 deletions

View file

@ -13,6 +13,8 @@ public partial class MareWizardModule
{
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
_logger.LogInformation("{method}:{userId}", nameof(ComponentVanity), Context.Interaction.User.Id);
StringBuilder sb = new();
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();
@ -52,6 +54,8 @@ public partial class MareWizardModule
{
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
_logger.LogInformation("{method}:{userId}:{uid}", nameof(SelectionVanityUid), Context.Interaction.User.Id, uid);
using var db = GetDbContext();
var user = db.Users.Single(u => u.UID == uid);
EmbedBuilder eb = new();
@ -71,6 +75,8 @@ public partial class MareWizardModule
{
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);
}
@ -79,6 +85,8 @@ public partial class MareWizardModule
{
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
_logger.LogInformation("{method}:{userId}:{uid}:{vanity}", nameof(ConfirmVanityUidModal), Context.Interaction.User.Id, uid, modal.DesiredVanityUID);
EmbedBuilder eb = new();
ComponentBuilder cb = new();
var desiredVanityUid = modal.DesiredVanityUID;
@ -121,6 +129,8 @@ public partial class MareWizardModule
[ComponentInteraction("wizard-vanity-gid")]
public async Task SelectionVanityGid(string gid)
{
_logger.LogInformation("{method}:{userId}:{uid}", nameof(SelectionVanityGid), Context.Interaction.User.Id, gid);
using var db = GetDbContext();
var group = db.Groups.Single(u => u.GID == gid);
EmbedBuilder eb = new();
@ -140,6 +150,8 @@ public partial class MareWizardModule
{
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);
}
@ -148,6 +160,8 @@ public partial class MareWizardModule
{
if (!(await ValidateInteraction().ConfigureAwait(false))) return;
_logger.LogInformation("{method}:{userId}:{gid}:{vanity}", nameof(ConfirmVanityGidModal), Context.Interaction.User.Id, gid, modal.DesiredVanityGID);
EmbedBuilder eb = new();
ComponentBuilder cb = new();
var desiredVanityUid = modal.DesiredVanityGID;