コード例 #1
0
 public async Task ShowKarmaOfOtherAsync(CommandContext context, [Description("The member whose karma you'd like to view.")] DiscordMember member)
 {
     using IBotAccessProvider provider = this.providerBuilder.Build();
     GuildKarmaRecord userKarmaRecord = provider.GetUsersGuildKarmaRecord(member.Id, context.Guild.Id);
     DiscordEmbed     response        = new DiscordEmbedBuilder()
                                        .AddField("Karma:", $"{userKarmaRecord.CurrentKarma}", true)
                                        .WithAuthor(member.DisplayName, iconUrl: member.AvatarUrl)
                                        .WithColor(member.Color);
     await context.RespondAsync(embed : response);
 }