Exemple #1
0
        public async Task Theme(CommandContext ctx, string theme)
        {
            string[] themes = CarbonHandler.GetThemes();

            if (!Array.Exists(themes, x => x == theme))
            {
                await ctx.Channel.SendErrorAsync("The theme provided does not match any themes", "use `ds carbon-themes` to get a list of available themes");

                return;
            }

            await ctx.TriggerTypingAsync();

            string path = $"./Images/Snippets/{theme}-theme.png";

            var msg = await new DiscordMessageBuilder()
                      .WithContent($"Theme snippet for {theme}")
                      .WithFile(path, File.OpenRead(path))
                      .SendAsync(ctx.Channel);
        }