Initial Commit
This commit is contained in:
commit
9b2f95aee4
108 changed files with 4815 additions and 0 deletions
39
Flux_System_Assistant/CommandModules/FactionCommands.cs
Normal file
39
Flux_System_Assistant/CommandModules/FactionCommands.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using Discord;
|
||||
using Discord.Interactions;
|
||||
|
||||
namespace Flux_System_Assistant.CommandModules;
|
||||
|
||||
public class FactionCommands : InteractionModuleBase<SocketInteractionContext>
|
||||
{
|
||||
[SlashCommand("register-factions", "Scans the server for existing factions and implements them into the database")]
|
||||
public async Task RegisterFactions()
|
||||
{
|
||||
var client = Context.Client;
|
||||
var currentGuild = Context.Guild;
|
||||
|
||||
await DeferAsync();
|
||||
|
||||
var embed = new EmbedBuilder()
|
||||
.WithAuthor(Context.User)
|
||||
.WithTitle("Associating Categories with Roles: ");
|
||||
|
||||
var embedField = new EmbedFieldBuilder()
|
||||
.WithName("Testingfield")
|
||||
.WithValue("Hello There")
|
||||
.WithIsInline(true);
|
||||
|
||||
string descriptor = String.Empty;
|
||||
|
||||
foreach(var groupChannel in currentGuild.CategoryChannels)
|
||||
{
|
||||
descriptor += $"{groupChannel} / {currentGuild.Roles.FirstOrDefault(x => x.Name == groupChannel.Name)?.Mention ?? "Not Found"}";
|
||||
descriptor += "\n";
|
||||
}
|
||||
|
||||
embed.WithDescription(descriptor);
|
||||
embed.AddField(embedField);
|
||||
|
||||
await FollowupAsync(embed: embed.Build());
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue