mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 18:17:22 +01:00
give registered role after modifying interaction
This commit is contained in:
parent
c73a810152
commit
f047435ad9
2 changed files with 8 additions and 3 deletions
|
|
@ -104,6 +104,7 @@ public partial class MareWizardModule
|
|||
ComponentBuilder cb = new();
|
||||
bool stillEnqueued = _botServices.VerificationQueue.Any(k => k.Key == Context.User.Id);
|
||||
bool verificationRan = _botServices.DiscordVerifiedUsers.TryGetValue(Context.User.Id, out bool verified);
|
||||
bool registerSuccess = false;
|
||||
if (!verificationRan)
|
||||
{
|
||||
if (stillEnqueued)
|
||||
|
|
@ -144,8 +145,7 @@ public partial class MareWizardModule
|
|||
+ Environment.NewLine
|
||||
+ "Have fun.");
|
||||
AddHome(cb);
|
||||
|
||||
await _botServices.AddRegisteredRoleAsync(Context.Interaction.User).ConfigureAwait(false);
|
||||
registerSuccess = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -168,6 +168,8 @@ public partial class MareWizardModule
|
|||
}
|
||||
|
||||
await ModifyInteraction(eb, cb).ConfigureAwait(false);
|
||||
if (registerSuccess)
|
||||
await _botServices.AddRegisteredRoleAsync(Context.Interaction.User).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<(bool, string)> HandleRegisterModalAsync(EmbedBuilder embed, LodestoneModal arg)
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ public partial class MareWizardModule
|
|||
ComponentBuilder cb = new();
|
||||
bool stillEnqueued = _botServices.VerificationQueue.Any(k => k.Key == Context.User.Id);
|
||||
bool verificationRan = _botServices.DiscordVerifiedUsers.TryGetValue(Context.User.Id, out bool verified);
|
||||
bool relinkSuccess = false;
|
||||
if (!verificationRan)
|
||||
{
|
||||
if (stillEnqueued)
|
||||
|
|
@ -130,7 +131,7 @@ public partial class MareWizardModule
|
|||
+ "Have fun.");
|
||||
AddHome(cb);
|
||||
|
||||
await _botServices.AddRegisteredRoleAsync(Context.Interaction.User).ConfigureAwait(false);
|
||||
relinkSuccess = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -147,6 +148,8 @@ public partial class MareWizardModule
|
|||
}
|
||||
|
||||
await ModifyInteraction(eb, cb).ConfigureAwait(false);
|
||||
if (relinkSuccess)
|
||||
await _botServices.AddRegisteredRoleAsync(Context.Interaction.User).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<(bool Success, string LodestoneAuth, string UID)> HandleRelinkModalAsync(EmbedBuilder embed, LodestoneModal arg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue