добавил патенты, верификацию, сделал паспорта, ип ооо

This commit is contained in:
Дмитрий Шиманский
2023-10-29 21:23:50 +03:00
parent 60fcf04532
commit 7c3e88376b
28 changed files with 1814 additions and 71 deletions

View File

@@ -0,0 +1,27 @@
using Discord;
using Discord.Interactions;
namespace DiscordApp.Justice.Commands
{
public class Bizness : InteractionModuleBase<SocketInteractionContext>
{
[SlashCommand("bizness-embed", "Отправляет сообщение с кнопками для регистрации")]
[DefaultMemberPermissions(GuildPermission.Administrator)]
public async Task sendBiznessEmbed()
{
await DeferAsync(true);
var Embed = new EmbedBuilder()
.WithTitle("**Регистрация бизнеса!**")
.WithDescription("Ниже вы можете нажать на кнопку для создания ИП или ООО!")
.WithColor(Color.Blue)
.Build();
var Components = new ComponentBuilder()
.WithButton(new ButtonBuilder() { CustomId = "NewIndividualEntrepreneur", Label = "ИП", Style = ButtonStyle.Primary })
.WithButton(new ButtonBuilder() { CustomId = "NewBizness", Label = "ООО", Style = ButtonStyle.Primary })
.Build();
await Context.Channel.SendMessageAsync(embed: Embed, components: Components);
await FollowupAsync("OK!");//, ephemeral: true);
}
}
}

View File

@@ -7,6 +7,7 @@ namespace DiscordApp.Justice.Commands
{
public InteractionService Commands { get; set; }
[SlashCommand("send_passport_embed", description: "Отправляет сообщение для регистрации паспортов")]
[DefaultMemberPermissions(GuildPermission.Administrator)]
public async Task sendPassportBuilerEmbed()
{
await DeferAsync(true);

View File

@@ -0,0 +1,29 @@
using Discord.Interactions;
using Discord;
namespace DiscordApp.Justice.Commands
{
public class Patents : InteractionModuleBase<SocketInteractionContext>
{
public InteractionService Commands { get; set; }
[SlashCommand("send_patent_embed", description: "Отправляет сообщение для регистрации паспортов")]
[DefaultMemberPermissions(GuildPermission.Administrator)]
public async Task sendPatentBuilerEmbed()
{
await DeferAsync(true);
var Embed = new EmbedBuilder()
.WithTitle("**Регистрация патента!**")
.WithDescription("Ниже вы можете нажать на кнопку для создания патентов!")
.WithColor(Color.Blue)
.Build();
var Components = new ComponentBuilder()
.WithButton(new ButtonBuilder() { CustomId = "artPatent", Label = "Патент на арт", Style = ButtonStyle.Primary })
.WithButton(new ButtonBuilder() { CustomId = "bookPatent", Label = "Патент на книгу", Style = ButtonStyle.Primary })
.Build();
await Context.Channel.SendMessageAsync(embed: Embed, components: Components);
await FollowupAsync("OK!");
}
}
}

View File

@@ -59,7 +59,7 @@ namespace DiscordApp.Discord.Commands
await DeferAsync(true);
var embed = new EmbedBuilder()
.WithTitle("**Верификация игроков**")
.WithDescription($"Если что-то случилось, и вам не выдается роль <@&1165687128366268511>, то нажмите на кнопку ниже!")
.WithDescription($"Если что-то случилось, и вам не выдается роль <@&1136564585420304444>, то нажмите на кнопку ниже!")
.WithImageUrl("")
.WithColor(Color.Blue)
.Build();
@@ -74,8 +74,25 @@ namespace DiscordApp.Discord.Commands
await Context.Channel.SendMessageAsync(embed: embed, components: components);
await FollowupAsync("Ok", ephemeral: true);
}
[SlashCommand("раздача-зарплаты", "Берет данные из баз данных и раздает кому надо")]
[DefaultMemberPermissions(GuildPermission.Administrator)]
public async Task giveAvanse()
{
await DeferAsync(true);
int allCount = 0;
var allReports = Startup.appDbContext.Reports.ToArray();
var allEmployee = new Dictionary<string, int>();
foreach (var report in allReports)
{
allEmployee[report.Employee] += (int)report.type;
// ReplyAsync is a method on ModuleBase
}
foreach (var employee in allEmployee)
{
await Startup.sp.CreateTransaction(employee.Key, employee.Value, "АвтоЗарплата Юстиций");
allCount += employee.Value;
}
await FollowupAsync($"Готово! Раздал {allCount} АР", ephemeral: true);
}
}
}

View File

@@ -0,0 +1,138 @@
using Discord;
using Discord.Interactions;
using DiscordApp.Database.Tables;
using DiscordApp.Justice.Modals;
using spworlds.Types;
namespace DiscordApp.Justice.Interactions
{
public class BiznessInteraction : InteractionModuleBase<SocketInteractionContext>
{
[ComponentInteraction("NewIndividualEntrepreneur")]
public async Task AplyWork()
=> await Context.Interaction.RespondWithModalAsync<INewIndividualEntrepreneur>("newIndividualEterpreneur");
[ComponentInteraction("NewBizness")]
public async Task reCreatePassport()
=> await Context.Interaction.RespondWithModalAsync<INewBizness>("NewBizness");
[ModalInteraction("newIndividualEterpreneur")]
public async Task newIndividualEterpreneur(INewIndividualEntrepreneur modal)
{
await DeferAsync(true);
Passport? applicant = await Startup.appDbContext.Passport.FindAsync(int.Parse(modal.passportId));
if (applicant == null)
{
await FollowupAsync("Ошибка! Такого паспорта не существует. Попробуйте старого бота.", ephemeral: true);
return;
}
User spApplicant = await User.CreateUser(applicant.Applicant);
var employees = new List<int>();
employees.Add(applicant.Id);
Bizness biznessDB = new()
{
Applicant = applicant,
Employee = ((IGuildUser)Context.User).DisplayName,
BiznessEmployes = employees.ToArray(),
BiznessName = modal.Name,
BiznessType = modal.BiznessType,
CardNumber = modal.CardNumber,
Date = DateTimeOffset.Now.ToUnixTimeSeconds()
};
Reports report = new()
{
Employee = ((IGuildUser)Context.User).DisplayName,
type = Types.ReportTypes.Bizness
};
await Startup.appDbContext.Reports.AddAsync(report);
await Startup.appDbContext.Bizness.AddAsync(biznessDB);
if (!modal.Name.StartsWith("test")) { await Startup.appDbContext.SaveChangesAsync(); }
var fieldBuilder = new EmbedFieldBuilder()
.WithName("Данные:")
.WithValue($"```Аппликант: {applicant.Applicant}\nНазвание: {modal.Name}\nТип деятельности: {modal.BiznessType}\nНомер карты:{modal.CardNumber}```");
var author = new EmbedAuthorBuilder()
.WithIconUrl(Context.User.GetAvatarUrl())
.WithName(((IGuildUser)Context.User).DisplayName);
var embed = new EmbedBuilder()
.WithTitle("Новый ИП зарегестрирован!")
.WithAuthor(author)
.WithFields(fieldBuilder)
.WithThumbnailUrl(spApplicant.GetSkinPart(SkinPart.face))
.WithColor(Color.Blue)
.Build();
await FollowupAsync("Готово!", ephemeral: true);
var channel = Context.Guild.GetChannel(1108006685626355733) as ITextChannel;
await channel.SendMessageAsync(embed: embed);
}
[ModalInteraction("NewBizness")]
public async Task newBizness(INewBizness modal)
{
await DeferAsync(true);
Passport? applicant = await Startup.appDbContext.Passport.FindAsync(int.Parse(modal.passportId));
if (applicant == null)
{
await FollowupAsync("Ошибка! Такого паспорта не существует. Попробуйте старого бота.", ephemeral: true);
return;
}
User spApplicant = await User.CreateUser(applicant.Applicant);
var employees = new List<int>
{
applicant.Id
};
string employeesNames = "";
foreach (var passportId in modal.BiznessEmployee.Split(","))
{
Passport? employee = await Startup.appDbContext.Passport.FindAsync(int.Parse(passportId));
if (employee != null) { employees.Add(employee.Id); employeesNames += $" {employee.Applicant}"; }
else
{
await FollowupAsync($"У {passportId} указан неправильный номер паспорта.", ephemeral: true);
}
}
Bizness biznessDB = new()
{
Applicant = applicant,
Employee = ((IGuildUser)Context.User).DisplayName,
BiznessEmployes = employees.ToArray(),
BiznessName = modal.Name,
BiznessType = modal.BiznessType,
CardNumber = modal.CardNumber,
Date = DateTimeOffset.Now.ToUnixTimeSeconds()
};
Reports report = new()
{
Employee = ((IGuildUser)Context.User).DisplayName,
type = Types.ReportTypes.Bizness
};
await Startup.appDbContext.Reports.AddAsync(report);
await Startup.appDbContext.Bizness.AddAsync(biznessDB);
if (!modal.Name.StartsWith("test")) { await Startup.appDbContext.SaveChangesAsync(); }
var fieldBuilder = new EmbedFieldBuilder()
.WithName("Данные:")
.WithValue($"```Аппликант: {applicant.Applicant}\nНазвание: {modal.Name}\nТип деятельности: {modal.BiznessType}\nНомер карты:{modal.CardNumber}\nСотрудники:{employeesNames}```");
var author = new EmbedAuthorBuilder()
.WithIconUrl(Context.User.GetAvatarUrl())
.WithName(((IGuildUser)Context.User).DisplayName);
var embed = new EmbedBuilder()
.WithTitle("Новый ООО зарегестрирован!")
.WithAuthor(author)
.WithFields(fieldBuilder)
.WithThumbnailUrl(spApplicant.GetSkinPart(SkinPart.face))
.WithColor(Color.Blue)
.Build();
await FollowupAsync("Готово!", ephemeral: true);
var channel = Context.Guild.GetChannel(1108006685626355733) as ITextChannel;
await channel.SendMessageAsync(embed: embed);
}
}
}

View File

@@ -4,7 +4,7 @@ using Discord.WebSocket;
using DiscordApp.Database.Tables;
using DiscordApp.Enums;
using spworlds.Types;
using DiscordApp.Justice.Modals;
namespace DiscordApp.Justice.Interactions
{
public class PassportInteraction : InteractionModuleBase<SocketInteractionContext>
@@ -15,16 +15,16 @@ namespace DiscordApp.Justice.Interactions
[ComponentInteraction("newPassport")]
public async Task AplyWork()
=> await Context.Interaction.RespondWithModalAsync<NewPassportModal>("passportModal");
=> await Context.Interaction.RespondWithModalAsync<INewPassportModal>("passportModal");
[ComponentInteraction("reworkPassport")]
public async Task reCreatePassport()
=> await Context.Interaction.RespondWithModalAsync<ReWorkPassportModal>("reworkpassportModal");
=> await Context.Interaction.RespondWithModalAsync<IReWorkPassportModal>("reworkpassportModal");
[ComponentInteraction("reNewPassportButton")]
public async Task reNewPassportModal() => await Context.Interaction.RespondWithModalAsync<NewPassportModal>("ReNewPassportModal");
public async Task reNewPassportModal() => await Context.Interaction.RespondWithModalAsync<INewPassportModal>("ReNewPassportModal");
[ModalInteraction("reworkpassportModal")]
public async Task reCreatePassportInteraction(ReWorkPassportModal modal)
public async Task reCreatePassportInteraction(IReWorkPassportModal modal)
{
await DeferAsync(true);
double passportId = modal.Id;
@@ -109,7 +109,7 @@ namespace DiscordApp.Justice.Interactions
}
}
[ModalInteraction("ReNewPassportModal")]
public async Task renewPassportInteraction(NewPassportModal modal)
public async Task renewPassportInteraction(INewPassportModal modal)
{
await DeferAsync(true);
string name = modal.NickName;
@@ -170,6 +170,12 @@ namespace DiscordApp.Justice.Interactions
Id = id,
Support = supporter
};
Reports report = new()
{
Employee = ((IGuildUser)Context.User).DisplayName,
type = Types.ReportTypes.editPassport
};
await Startup.appDbContext.Reports.AddAsync(report);
if (Startup.appDbContext.Passport.FindAsync(passport.Id).Result != null)
{
@@ -219,7 +225,7 @@ namespace DiscordApp.Justice.Interactions
}
[ModalInteraction("passportModal")]
public async Task createPassportInteraction(NewPassportModal modal)
public async Task createPassportInteraction(INewPassportModal modal)
{
await DeferAsync(true);
string name = modal.NickName;
@@ -233,7 +239,7 @@ namespace DiscordApp.Justice.Interactions
Random random = new();
User spUser = await User.CreateUser(name);
DateTimeOffset toTime = DateTime.Now.AddDays(14);
DateTimeOffset toTime;
DateTime birthDate;
int id = random.Next(00001, 99999);
long unixTime;
@@ -244,8 +250,12 @@ namespace DiscordApp.Justice.Interactions
unixTime = ((DateTimeOffset)birthDate).ToUnixTimeSeconds();
if (birthDate.AddDays(14) < DateTime.Now)
{
await FollowupAsync($"Возможно, игрок {name} больше не новичек, и бесплатный паспорт ему не положен! Оформляю паспорт на месяц...0", ephemeral: true);
toTime = DateTimeOffset.Now.AddDays(60);
await FollowupAsync($"Возможно, игрок {name} больше не новичек, и бесплатный паспорт ему не положен! Оформляю паспорт на месяц...", ephemeral: true);
toTime = DateTimeOffset.Now.AddMonths(2);
}
else
{
toTime = DateTime.Now.AddDays(14);
}
}
catch (Exception ex)
@@ -324,54 +334,20 @@ namespace DiscordApp.Justice.Interactions
.WithTimestamp(toTime)
.Build();
Reports report = new()
{
Employee = ((IGuildUser)Context.User).DisplayName,
type = Types.ReportTypes.NewPassport
};
await Startup.appDbContext.Reports.AddAsync(report);
await Startup.appDbContext.Passport.AddAsync(passport);
await Startup.appDbContext.SaveChangesAsync();
await FollowupAsync($"ID для паспорта: {id}", embed: embed, ephemeral: true);
var channel = Context.Guild.GetChannel(1108006685626355733) as ITextChannel;
var message = await channel.SendMessageAsync(embed: embed);
await channel.SendMessageAsync(embed: embed);
}
}
public class NewPassportModal : IModal
{
public string Title => "Создание паспорта";
[InputLabel("Ник игрока")]
[ModalTextInput("nickname", TextInputStyle.Short, placeholder: "YaFlay", maxLength: 90)]
public string NickName { get; set; }
[InputLabel("Благотворитель")]
[ModalTextInput("Supporter", TextInputStyle.Short, placeholder: "1", maxLength: 5)]
public int Supporter { get; set; }
[InputLabel("РП Имя")]
[ModalTextInput("rolePlayName", TextInputStyle.Short, placeholder: "Олег Бебров", maxLength: 200)]
public string RPName { get; set; }
[InputLabel("Пол")]
[ModalTextInput("gender", TextInputStyle.Short, maxLength: 200)]
public string Gender { get; set; }
[InputLabel("Дата рождения")]
[ModalTextInput("BirthDay", TextInputStyle.Short, placeholder: "16.02.2023", maxLength: 100)]
public string Birthday { get; set; }
}
public class ReWorkPassportModal : IModal
{
public string Title => "Создание паспорта";
[InputLabel("ID паспорта")]
[ModalTextInput("id", TextInputStyle.Short, placeholder: "82-777", maxLength: 7)]
public double Id { get; set; }
[InputLabel("Новые данные(0/1)")]
[ModalTextInput("isNewPassportData", TextInputStyle.Short, placeholder: "1 - да, 0 - нет", maxLength: 1, initValue: "0")]
public int IsNewPassport { get; set; }
}
}

View File

@@ -1,6 +0,0 @@
namespace DiscordApp.Justice.Interactions
{
public class Patents
{
}
}

View File

@@ -0,0 +1,147 @@
using Discord.Interactions;
using DiscordApp.Justice.Modals;
using DiscordApp.Database.Tables;
using Discord.WebSocket;
using Discord;
using spworlds.Types;
namespace DiscordApp.Justice.Interactions
{
public class PatentInteraction : InteractionModuleBase<SocketInteractionContext>
{
[ComponentInteraction("artPatent")]
public async Task artPatentInteractions() => await RespondWithModalAsync<INewArtModal>("newArtCallback");
[ComponentInteraction("bookPatent")]
public async Task bookPatentInteractions() => await RespondWithModalAsync<INewBookModal>("newBookCallback");
[ModalInteraction("newArtCallback")]
public async Task newArtModalInteraction(INewArtModal modal)
{
await DeferAsync(true);
string name = modal.Name;
string maps = modal.MapNumbers;
string size = modal.Size;
int passportId = modal.PassportId;
bool isAllowedToReSell = modal.IsAllowedToResell == 1;
Passport? passport = await Startup.appDbContext.Passport.FindAsync(passportId);
if (passport == null)
{
await FollowupAsync("ID паспорта не найден в базе данных. Попробуйте использовать старого бота.");
return;
}
var mapDictionary = new List<int>();
User spUser = await User.CreateUser(passport.Applicant);
try
{
foreach (var map in maps.Split(','))
{
mapDictionary.Add(int.Parse(map));
}
}
catch (Exception ex)
{
await Console.Out.WriteLineAsync($"new error in patentInteractions 32-37 {ex.Message}");
await FollowupAsync("Возникла ошибка при парсинге ID карт. Вы точно указали через запятую данные?");
return;
}
ArtsPatents artsPatent = new()
{
Name = name,
Employee = ((IGuildUser)Context.User).DisplayName,
Size = size,
Date = DateTimeOffset.Now.ToUnixTimeSeconds(),
Number = mapDictionary.ToArray(),
isAllowedToResell = isAllowedToReSell,
passport = passport
};
Reports report = new()
{
Employee = ((IGuildUser)Context.User).DisplayName,
type = Types.ReportTypes.Patent
};
await Startup.appDbContext.Reports.AddAsync(report);
await Startup.appDbContext.ArtPatents.AddAsync(artsPatent);
if (!name.StartsWith("test")) { await Startup.appDbContext.SaveChangesAsync(); }
var field = new EmbedFieldBuilder()
.WithName("Данные патента")
.WithValue($"```Название арта: {name} \nРазмер: {size} \nНомера: {maps} \nРазрешена перепродажа?: {isAllowedToReSell} \nАппликант: {passport.Applicant}```")
.WithIsInline(false);
var author = new EmbedAuthorBuilder()
.WithIconUrl(Context.User.GetAvatarUrl())
.WithName(((IGuildUser)Context.User).DisplayName);
var Embed = new EmbedBuilder()
.WithTitle("Новый патент!")
.WithFields(field)
.WithAuthor(author)
.WithColor(Color.Blue)
.WithCurrentTimestamp()
.WithThumbnailUrl(spUser.GetSkinPart(SkinPart.face))
.Build();
await FollowupAsync("Готово!", ephemeral: true);
var channel = Context.Guild.GetChannel(1108006685626355733) as ITextChannel;
await channel.SendMessageAsync(embed: Embed);
}
[ModalInteraction("newBookCallback")]
public async Task newBookModalInteraction(INewBookModal modal)
{
await DeferAsync(true);
string name = modal.Name;
string janre = modal.Janre;
string annotation = modal.Annotation;
int passportId = modal.PassportId;
bool isAllowedToReSell = modal.IsAllowedToResell == 1;
Passport? passport = await Startup.appDbContext.Passport.FindAsync(passportId);
if (passport == null)
{
await FollowupAsync("ID паспорта не найден в базе данных. Попробуйте использовать старого бота.");
return;
}
User spUser = await User.CreateUser(passport.Applicant);
BooksPatents bookPatent = new()
{
Name = name,
Employee = ((IGuildUser)Context.User).DisplayName,
Janre = janre,
Date = DateTimeOffset.Now.ToUnixTimeSeconds(),
Annotation = annotation,
isAllowedToResell = isAllowedToReSell,
passport = passport
};
Reports report = new()
{
Employee = ((IGuildUser)Context.User).DisplayName,
type = Types.ReportTypes.Patent
};
await Startup.appDbContext.Reports.AddAsync(report);
await Startup.appDbContext.BookPatents.AddAsync(bookPatent);
if (!name.StartsWith("test")) { await Startup.appDbContext.SaveChangesAsync(); }
var field = new EmbedFieldBuilder()
.WithName("Данные патента")
.WithValue($"```Название книги: {name} \nАннотация: {annotation} \nЖанр: {janre} \nРазрешена перепродажа?:{isAllowedToReSell} \nАппликант:{passport.Applicant}```")
.WithIsInline(false);
var author = new EmbedAuthorBuilder()
.WithIconUrl(Context.User.GetAvatarUrl())
.WithName(((IGuildUser)Context.User).DisplayName);
var Embed = new EmbedBuilder()
.WithTitle("Новый патент!")
.WithFields(field)
.WithAuthor(author)
.WithColor(Color.Blue)
.WithCurrentTimestamp()
.WithThumbnailUrl(spUser.GetSkinPart(SkinPart.face))
.Build();
await FollowupAsync("Готово!", ephemeral: true);
var channel = Context.Guild.GetChannel(1108006685626355733) as ITextChannel;
await channel.SendMessageAsync(embed: Embed);
}
}
}

View File

@@ -15,7 +15,7 @@ namespace DiscordApp.Justice.Interactions
{
await FollowupAsync("Готово!", ephemeral: true);
var guildUser = Context.Guild.GetUser(Context.User.Id);
await guildUser.AddRoleAsync(1165687128366268511);
await guildUser.AddRoleAsync(1136564585420304444);
await guildUser.ModifyAsync(func =>
{
func.Nickname = user.Name;

View File

@@ -0,0 +1,49 @@
using Discord;
using Discord.Interactions;
namespace DiscordApp.Justice.Modals
{
public class INewIndividualEntrepreneur : IModal
{
public string Title => "Регистрация ИП";
[InputLabel("ID паспорта")]
[ModalTextInput("nickname", TextInputStyle.Short, placeholder: "96534", maxLength: 10)]
public string passportId { get; set; }
[InputLabel("Название")]
[ModalTextInput("Name", TextInputStyle.Short, placeholder: "ИП Оганесян", maxLength: 100)]
public string Name { get; set; }
[InputLabel("Тип деятельности")]
[ModalTextInput("Type", TextInputStyle.Short, placeholder: "Продажа", maxLength: 200)]
public string BiznessType { get; set; }
[InputLabel("Номер карты")]
[ModalTextInput("cardNumber", TextInputStyle.Short, placeholder: "70835", maxLength: 100)]
public int CardNumber { get; set; }
}
public class INewBizness : IModal
{
public string Title => "Регистрация ИП";
[InputLabel("ID паспорта")]
[ModalTextInput("nickname", TextInputStyle.Short, placeholder: "96534", maxLength: 10)]
public string passportId { get; set; }
[InputLabel("Название")]
[ModalTextInput("Name", TextInputStyle.Short, placeholder: "ИП Оганесян", maxLength: 100)]
public string Name { get; set; }
[InputLabel("Тип деятельности")]
[ModalTextInput("Type", TextInputStyle.Short, placeholder: "Продажа", maxLength: 200)]
public string BiznessType { get; set; }
[InputLabel("Участники(через запятую)")]
[ModalTextInput("Employee", TextInputStyle.Short, placeholder: "96534, 12742", maxLength: 200)]
public string BiznessEmployee { get; set; }
[InputLabel("Номер карты")]
[ModalTextInput("cardNumber", TextInputStyle.Short, placeholder: "70835", maxLength: 100)]
public int CardNumber { get; set; }
}
}

View File

@@ -0,0 +1,46 @@
using Discord.Interactions;
using Discord;
namespace DiscordApp.Justice.Modals
{
public class INewPassportModal : IModal
{
public string Title => "Создание паспорта";
[InputLabel("Ник игрока")]
[ModalTextInput("nickname", TextInputStyle.Short, placeholder: "YaFlay", maxLength: 90)]
public string NickName { get; set; }
[InputLabel("Благотворитель")]
[ModalTextInput("Supporter", TextInputStyle.Short, placeholder: "1", maxLength: 5)]
public int Supporter { get; set; }
[InputLabel("РП Имя")]
[ModalTextInput("rolePlayName", TextInputStyle.Short, placeholder: "Олег Бебров", maxLength: 200)]
public string RPName { get; set; }
[InputLabel("Пол")]
[ModalTextInput("gender", TextInputStyle.Short, maxLength: 200)]
public string Gender { get; set; }
[InputLabel("Дата рождения")]
[ModalTextInput("BirthDay", TextInputStyle.Short, placeholder: "16.02.2023", maxLength: 100)]
public string Birthday { get; set; }
}
public class IReWorkPassportModal : IModal
{
public string Title => "Создание паспорта";
[InputLabel("ID паспорта")]
[ModalTextInput("id", TextInputStyle.Short, placeholder: "82-777", maxLength: 7)]
public double Id { get; set; }
[InputLabel("Новые данные(0/1)")]
[ModalTextInput("isNewPassportData", TextInputStyle.Short, placeholder: "1 - да, 0 - нет", maxLength: 1, initValue: "0")]
public int IsNewPassport { get; set; }
}
}

View File

@@ -0,0 +1,54 @@
using Discord;
using Discord.Interactions;
namespace DiscordApp.Justice.Modals
{
public class INewArtModal : IModal
{
public string Title => "Новый патент на арт";
[InputLabel("ID паспорта")]
[ModalTextInput("passportId", TextInputStyle.Short, placeholder: "97664", maxLength: 10)]
public int PassportId { get; set; }
[InputLabel("Название арта")]
[ModalTextInput("artName", TextInputStyle.Short, placeholder: "Пикачу", maxLength: 100)]
public string Name { get; set; }
[InputLabel("Номера карт арта(Через запятую)")]
[ModalTextInput("mapNumbers", TextInputStyle.Short, placeholder: "14322, 14323")]
public string MapNumbers { get; set; }
[InputLabel("Размер арта")]
[ModalTextInput("artSize", TextInputStyle.Short, placeholder: "3х1")]
public string Size { get; set; }
[InputLabel("Разрешено ли перепродавать(0/1)")]
[ModalTextInput("artResell", TextInputStyle.Short, placeholder: "0 - нет, 1 - да")]
public int IsAllowedToResell { get; set; }
}
public class INewBookModal : IModal
{
public string Title => "Новый патент на книгу";
[InputLabel("ID паспорта")]
[ModalTextInput("passportId", TextInputStyle.Short, placeholder: "97664", maxLength: 10)]
public int PassportId { get; set; }
[InputLabel("Название книги")]
[ModalTextInput("bookName", TextInputStyle.Short, placeholder: "Пикачу", maxLength: 100)]
public string Name { get; set; }
[InputLabel("Аннотация")]
[ModalTextInput("bookAnnotation", TextInputStyle.Short, placeholder: "14322, 14323")]
public string Annotation { get; set; }
[InputLabel("Жанр")]
[ModalTextInput("bookJanre", TextInputStyle.Short, placeholder: "3х1")]
public string Janre { get; set; }
[InputLabel("Разрешено ли перепродавать(0/1)")]
[ModalTextInput("bookResell", TextInputStyle.Short, placeholder: "0 - нет, 1 - да")]
public int IsAllowedToResell { get; set; }
}
}