public async Task DrawTextAsync([Remainder] string input) { var properties = new ImageProperties(); // new CanvasOptions { UseNonEmptyWidth = true, Padding = new Padding(2), BackgroundColor = new OriColor(0x0C525F) } // TODO: Implment OptionAttribute parsing using (Bitmap bmp = _graphics.DrawText(input)) await Context.Channel.SendImageAsync(bmp, $"../tmp/{Context.User.Id}_string.png"); }
public async Task GetTimeAsync() { try { string path = $"../tmp/{Context.User.Id}_time.png"; GammaPalette palette = TimeCycle.FromUtcNow(); using var graphics = new GraphicsService(); Bitmap bmp = graphics.DrawText(DateTime.UtcNow.ToString("hh:mm tt").ToUpper(), Gamma.Max, palette); await Context.Channel.SendImageAsync(bmp, path); } catch (Exception ex) { await Context.Channel.CatchAsync(ex); } }