Beispiel #1
0
            public async Task DeleteExplanation([Remainder, Summary("Topic to delete")] string topic)
            {
                var file = ExplanationDirectory.GetFiles().FirstOrDefault(f => f.Name == topic + ".txt");

                if (file == null)
                {
                    await ReplyAsync($"`{topic}` doesn't exist, check your spelling.");

                    return;
                }
                file.Delete();
                await ReplyAsync($"Successfully deleted `{topic}`.");
            }
Beispiel #2
0
            public async Task ExplainList()
            {
                List <string> explanations = new List <string>();

                foreach (var explanation in ExplanationDirectory.GetFiles())
                {
                    explanations.Add($"`{explanation.Name.Split(".")[0]}`");
                }
                var ExplainListEmbed = new EmbedBuilder()
                                       .WithTitle("All explanations")
                                       .WithColor(Color.Orange)
                                       .WithDescription(string.Join(", ", explanations))
                                       .Build();

                await ReplyAsync(embed : ExplainListEmbed);
            }