public async Task GenericQuery(string opts, [Remainder] string cmd) { var options = MiscUtil.ExtractOrNot(opts, ref cmd); if (options.ContainsKey("t")) { options.Add("type", options["t"]); } if (!options.ContainsKey("type")) { options.Add("type", "table"); } if (!dsv.Exists($"dc-{Context.Guild.Id}")) { await Context.Message.AddReactionAsync(new Emoji("📡")); } GuildDatabase db = dsv.GetOrInitDatabase($"dc-{Context.Guild.Id}"); var command = db.CreateCommand(cmd); try { var tt = db.Query(GuildDatabase.QueryTypeShorthand(options["type"]), command); await Context.Message.AddReactionAsync(new Emoji("🆗")); if (tt.Length > 0) { if (options.ContainsKey("nowrap")) { await ReplyAsync(tt); } else { await ReplyAsync($"```\n{tt}\n```"); } } else { await Context.Message.AddReactionAsync(new Emoji("🤔")); } } catch (Exception e) when(e is DbException || e is UserCommandException) { await ReplyAsync(":exclamation: " + e.Message.Replace("SQL logic error\n", "").Trim()); } }