UrbandiDt

- Added some debugging
This commit is contained in:
Tristan B. Velloza Kildaire 2023-07-03 14:51:24 +02:00
parent ebe50679b7
commit ae31c7b2c0
1 changed files with 18 additions and 1 deletions

View File

@ -56,7 +56,9 @@ public final class UrbanDict : Mod
if(splits.length >= 2)
{
writeln("Are we ongod yet? ",messageBody.indexOf(" "));
string searchTerm = strip(messageBody[messageBody.indexOf(" ")..$]);
writeln("search term: '"~searchTerm~"'");
try
{
@ -77,6 +79,12 @@ public final class UrbanDict : Mod
import birchwood.protocol.formatting;
writeln("Def '"~definition~"'");
writeln("Ex '"~example~"'");
writeln("Au '"~definition~"'");
writeln("Perm '"~permalink~"'");
getBot().channelMessage(bold("Definition: ")~definition, channel);
getBot().channelMessage(bold("Example: ")~example, channel);
getBot().channelMessage(bold("Author: ")~author, channel);
@ -102,6 +110,14 @@ public final class UrbanDict : Mod
else
{
// Do nothing
writeln("IMM A W ");
writeln("IMM A W ");
writeln("IMM A W ");
writeln("IMM A W ");
writeln("IMM A W ");
writeln("IMM A W ");
writeln("IMM A W ");
writeln("IMM A W ");
}
}
@ -116,9 +132,10 @@ public final class UrbanDict : Mod
import std.stdio;
// writeln("UB result: ", data);
string data = cast(string)get(ubBase~term);
writeln("UB result: ", data);
JSONValue[] json = parseJSON(data)["list"].array();
return json;