From 6fb6db717e96add75877856f92d8774dc0262d99 Mon Sep 17 00:00:00 2001 From: Kingsman Date: Thu, 1 Feb 2024 03:06:26 +0800 Subject: [PATCH 1/2] Added Info Command --- Bot/Dc/Cmds.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Bot/Dc/Cmds.cs b/Bot/Dc/Cmds.cs index f9bc5ed..1e4d6bb 100644 --- a/Bot/Dc/Cmds.cs +++ b/Bot/Dc/Cmds.cs @@ -69,5 +69,10 @@ public async Task AltAsync(Member alt, Member main) await RespondAsync($"`{clanAlt.Name}` is an alt of `{clanMain.Name}`"); } - + [SlashCommand("info", "Check the User's infomation")] + public async Task InfoAsync(Member member) + { + ClanMember cocMem = Coc.GetMember(member.CocId); + await RespondAsync($"{cocMem.Tag} {cocMem.Name}"); + } } From 8d890f47176dc2434fd1579e6aed25427edeb134 Mon Sep 17 00:00:00 2001 From: Kingsman Date: Thu, 22 Feb 2024 01:42:01 +1100 Subject: [PATCH 2/2] Use embed UI --- Bot/Dc/Cmds.cs | 16 ++++++++++++++-- Bot/Sql/Donation.cs | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Bot/Dc/Cmds.cs b/Bot/Dc/Cmds.cs index 1e4d6bb..585615c 100644 --- a/Bot/Dc/Cmds.cs +++ b/Bot/Dc/Cmds.cs @@ -1,4 +1,5 @@ using ClashOfClans.Models; +using Discord; using Discord.Interactions; using Discord.WebSocket; using Hyperstellar.Dc.Attr; @@ -69,10 +70,21 @@ public async Task AltAsync(Member alt, Member main) await RespondAsync($"`{clanAlt.Name}` is an alt of `{clanMain.Name}`"); } - [SlashCommand("info", "Check the User's infomation")] + [SlashCommand("info", "Print the member's infomation")] public async Task InfoAsync(Member member) { ClanMember cocMem = Coc.GetMember(member.CocId); - await RespondAsync($"{cocMem.Tag} {cocMem.Name}"); + + var embed = new EmbedBuilder + { + Title = cocMem.Name, + Author = new EmbedAuthorBuilder + { + Name = cocMem.Tag, + }, + + }; + + await RespondAsync(embed: embed.Build()); } } diff --git a/Bot/Sql/Donation.cs b/Bot/Sql/Donation.cs index 7223a4b..50214e1 100644 --- a/Bot/Sql/Donation.cs +++ b/Bot/Sql/Donation.cs @@ -5,7 +5,7 @@ namespace Hyperstellar.Sql; internal sealed class Donation(string id) { [PrimaryKey, NotNull] - public string Id { get; set; } = id; + public string MainId { get; set; } = id; [NotNull] public uint Donated { get; set; } = 0;