misc.wolfram: line -> query

This commit is contained in:
Cynthia Foxwell 2022-11-29 19:40:59 -07:00
parent 9d1ff77b11
commit 295a04a4fa
1 changed files with 4 additions and 4 deletions

View File

@ -81,7 +81,7 @@ wolfram.callback = async function (msg, line, [query], {verbose, v}) {
const req = await fetch(
`http://api.wolframalpha.com/v2/query?input=${encodeURIComponent(
line
query
)}&appid=LH2K8H-T3QKETAGT3&output=json`
).then((x) => x.json());
@ -94,7 +94,7 @@ wolfram.callback = async function (msg, line, [query], {verbose, v}) {
if (_verbose) {
const embed = {
title: `Result for: \`${safeString(line)}\``,
title: `Result for: \`${safeString(query)}\``,
fields: [],
footer: {
icon_url: "http://www.wolframalpha.com/share.png",
@ -137,11 +137,11 @@ wolfram.callback = async function (msg, line, [query], {verbose, v}) {
if (data[1].subpods[0].plaintext.length > 0)
string = safeString(data[1].subpods[0].plaintext);
if (string.length > 2000 - (6 + safeString(line).length))
if (string.length > 2000 - (6 + safeString(query).length))
string = "Output too long: " + (await hastebin(string));
return {
content: `\`${safeString(line)}\` -> ${string.length > 0 ? string : ""}`,
content: `\`${safeString(query)}\` -> ${string.length > 0 ? string : ""}`,
file: image && {
file: image,
name: "wolfram_output.gif",