add discord bot

change net6.0 net7.0
This commit is contained in:
Дмитрий Шиманский
2023-10-26 11:35:42 +03:00
parent 7c6fafa9e6
commit 9a8a4cad5d
35 changed files with 1132 additions and 37 deletions

View File

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