This commit is contained in:
Дмитрий Шиманский
2023-11-09 00:24:18 +03:00
parent 0b218a4c6d
commit dde8b38520
16 changed files with 243 additions and 40 deletions

View File

@@ -0,0 +1,31 @@
using Discord.Interactions;
using Discord;
namespace DiscordApp.Justice.Commands
{
public class Getters : InteractionModuleBase<SocketInteractionContext>
{
[SlashCommand("embed-getter-passport", "Отправляет сообщение для поиска паспорта")]
[DefaultMemberPermissions(GuildPermission.Administrator)]
public async Task getPassport()
{
await DeferAsync(true);
var embed = new EmbedBuilder()
.WithTitle("Получение информации о паспорте")
.WithDescription("Нажав на кнопку ниже вы можете получить данные о том, или ином игроке")
.WithColor(Color.DarkBlue)
.Build();
var components = new ComponentBuilder()
.WithButton(new ButtonBuilder()
{
CustomId = "searchPassport",
Label = "Поиск паспорта",
Style = ButtonStyle.Success
})
.Build();
var channel = Context.Channel as ITextChannel;
await channel.SendMessageAsync(embed: embed, components: components);
await FollowupAsync("Готово!", ephemeral: true);
}
}
}

View File

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

View File

@@ -98,13 +98,14 @@ namespace DiscordApp.Discord.Commands
}
}
Startup startup = new();
foreach (var employee in allEmployee)
{
try
{
Startup startup = new ();
await Startup.sp.CreateTransaction(startup.getUserData(employee.Key).Result.cardsOwned.First().number, employee.Value, $"zp {employee.Key}");
var userData = await startup.getUserData(employee.Key);
await Startup.sp.CreateTransaction(userData.cardsOwned.First().number, employee.Value, $"zp {employee.Key}");
await Console.Out.WriteLineAsync($"{employee.Key}, {employee.Value}");
allCount += employee.Value;
}