add timer-cnhager nickname

This commit is contained in:
Дмитрий Шиманский
2023-11-03 18:38:18 +03:00
parent e977fb2abd
commit 7f0728ce1a
6 changed files with 50 additions and 24 deletions

View File

@@ -10,15 +10,15 @@ namespace DiscordApp.Justice.Interactions
{
[ComponentInteraction("NewIndividualEntrepreneur")]
public async Task AplyWork()
=> await Context.Interaction.RespondWithModalAsync<INewIndividualEntrepreneur>("newIndividualEterpreneur");
=> await Context.Interaction.RespondWithModalAsync<INewIndividualEntrepreneur>("newIndividualEterpreneurModal");
[ComponentInteraction("NewBizness")]
public async Task reCreatePassport()
=> await Context.Interaction.RespondWithModalAsync<INewBizness>("NewBizness");
=> await Context.Interaction.RespondWithModalAsync<INewBizness>("NewBiznessModal");
[ModalInteraction("newIndividualEterpreneur")]
[ModalInteraction("newIndividualEterpreneurModal")]
public async Task newIndividualEterpreneur(INewIndividualEntrepreneur modal)
{
await DeferAsync(true);
Passport? applicant = await Startup.appDbContext.Passport.FindAsync(int.Parse(modal.passportId));
if (applicant == null)
{
@@ -68,10 +68,10 @@ namespace DiscordApp.Justice.Interactions
await channel.SendMessageAsync(embed: embed);
}
[ModalInteraction("NewBizness")]
[ModalInteraction("NewBiznessModal")]
public async Task newBizness(INewBizness modal)
{
await DeferAsync(true);
Passport? applicant = await Startup.appDbContext.Passport.FindAsync(int.Parse(modal.passportId));
if (applicant == null)

View File

@@ -28,8 +28,9 @@ namespace DiscordApp.Justice.Interactions
[ModalInteraction("reworkpassportModal")]
public async Task reCreatePassportInteraction(IReWorkPassportModal modal)
{
await DeferAsync(true);
double passportId = modal.Id;
int passportId;
int.TryParse(modal.Id, out passportId);
bool recreatePassport = modal.IsNewPassport == 1;
if (recreatePassport)
{
@@ -37,6 +38,7 @@ namespace DiscordApp.Justice.Interactions
}
else
{
if (passportId == null) { await FollowupAsync("Айди паспорта устаревший, используйте кнопку \"Создать новый\" для создания паспорта", ephemeral: true); return; }
var passport = Startup.appDbContext.Passport.Where(x => x.Id == passportId).FirstOrDefault();
if (passport == null) { await FollowupAsync("ID паспорта не правильный, или не существует.", ephemeral: true); return; }
@@ -113,7 +115,7 @@ namespace DiscordApp.Justice.Interactions
[ModalInteraction("ReNewPassportModal")]
public async Task renewPassportInteraction(INewPassportModal modal)
{
await DeferAsync(true);
string name = modal.NickName;
string RpName = modal.RPName;
int supporterInt = modal.Supporter;
@@ -239,7 +241,7 @@ namespace DiscordApp.Justice.Interactions
[ModalInteraction("passportModal")]
public async Task createPassportInteraction(INewPassportModal modal)
{
await DeferAsync(true);
string name = modal.NickName;
string RpName = modal.RPName;
int supporterInt = modal.Supporter;

View File

@@ -18,7 +18,7 @@ namespace DiscordApp.Justice.Interactions
[ModalInteraction("newArtCallback")]
public async Task newArtModalInteraction(INewArtModal modal)
{
await DeferAsync(true);
string name = modal.Name;
string maps = modal.MapNumbers;
string size = modal.Size;
@@ -89,7 +89,7 @@ namespace DiscordApp.Justice.Interactions
[ModalInteraction("newBookCallback")]
public async Task newBookModalInteraction(INewBookModal modal)
{
await DeferAsync(true);
string name = modal.Name;
string janre = modal.Janre;
string annotation = modal.Annotation;