Initial Commit

This commit is contained in:
Sebastian Fischlmayr 2023-05-04 13:46:14 +02:00
commit 9b2f95aee4
Signed by: Maverick
GPG key ID: 6379E413924A4E77
108 changed files with 4815 additions and 0 deletions

View 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());
}
}