public async Task GetEmbedPresetListAsync() { var fileNames = EmbedPreset.GetPresetNames(); string message = "Embed presets:\n```"; fileNames.ForEach(x => message += x + "\n"); message += "```"; await ReplyAsync(message); }
public async Task SendEmbedPresetAsync(ITextChannel channel, string presetName) { if (!EmbedPreset.PresetExists(presetName)) { await ReplyAsync("Preset not found"); return; } await channel.SendMessageAsync(embed : EmbedPreset.LoadPreset(presetName).ConstructEmbed()); }
public async Task AddNewEmbedPresetAsync(string name) { if (EmbedPreset.PresetExists(name)) { await ReplyAsync("Preset with that name already exists"); return; } if (Context.Message.Attachments.Count == 0) { await ReplyAsync("No attachment found"); return; } var attachment = Context.Message.Attachments.FirstOrDefault(x => x.Filename[(x.Filename.LastIndexOf('.') + 1)..] == "txt");