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

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);
}
}
}