mirror of
https://github.com/yawaflua/PL_JusticeBot.git
synced 2026-02-04 02:24:14 +02:00
добавил патенты, верификацию, сделал паспорта, ип ооо
This commit is contained in:
27
Justice/Commands/Bizness.cs
Normal file
27
Justice/Commands/Bizness.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
29
Justice/Commands/Patents.cs
Normal file
29
Justice/Commands/Patents.cs
Normal 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!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user