Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Info Command #12

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Bot/Discord/Cmds.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using ClashOfClans.Models;
using Discord;
using Discord.Interactions;
using Discord.WebSocket;
using Hyperstellar.Discord.Attr;
using Hyperstellar.Sql;
using Hyperstellar.Clash;
using Discord;

Check warning on line 8 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[RedundantUsingDirective] Using directive is not required by the code and can be safely removed" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(8,178)

Check warning on line 8 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[IDE0005] Using directive is unnecessary." on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(8,178)

namespace Hyperstellar.Discord;

Expand Down Expand Up @@ -71,9 +72,26 @@
await RespondAsync($"`{clanAlt.Name}` is now an alt of `{clanMain.Name}`");
}

[SlashCommand("info", "Print the member's infomation")]
public async Task InfoAsync(Member member)
{
ClanMember cocMem = Coc.GetMember(member.CocId);

var embed = new EmbedBuilder

Check notice on line 80 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[SuggestVarOrType_SimpleTypes] Use explicit type (simple types)" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(80,2138)

Check warning on line 80 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[IDE0008] Use explicit type instead of 'var'" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(80,2138)
Copy link
Member

@Pythonic-Rainbow Pythonic-Rainbow Feb 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the coding convention, I don't use var

{
Title = cocMem.Name,
Author = new EmbedAuthorBuilder
{
Name = cocMem.Tag,

Check notice on line 85 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[ArrangeTrailingCommaInMultilineLists] Remove trailing comma to conform to code style" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(85,2301)
},

};

await RespondAsync(embed: embed.Build());

[RequireAdmin]

Check warning on line 92 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[IDE0055] Fix formatting" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(92,2386)
[SlashCommand("link", "[Admin] Links a Discord account to a Main")]

Check warning on line 93 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[IDE0055] Fix formatting" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(93,2405)
public async Task LinkAsync(Member coc, IGuildUser discord)

Check failure on line 94 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / build

The modifier 'public' is not valid for this item

Check failure on line 94 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[CSharpErrors] Invalid modifier 'public' in local function declaration" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(94,2477)
{
Main? main = coc.TryToMain();
if (main == null)
Expand All @@ -90,4 +108,4 @@
main.Update();
await RespondAsync("Linked");
}
}

Check failure on line 111 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / build

} expected

Check failure on line 111 in Bot/Discord/Cmds.cs

View workflow job for this annotation

GitHub Actions / inspect

"[CSharpErrors] } expected" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord/Cmds.cs(111,2936)
Loading