Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] Rollable Tables Inline via API

I have a rollable table that I'm trying to get via the sendChat callback. It works if I do /roll but it doesn't work if I do [[1t[LocationTable]]]. However, if I type [[1t[LocationTable]]] in chat it works as expected, displaying the name inline.

The error I get is:
Could not determine result type of: [{"type":"M","expr":1},{"type":"C","text":"t[LocationTable"}]

I need the roll to be inline so that I can pass multiple parameters to the callback and have all the information I need.

Anyone know why this works when typed but not when sent via sendChat?
March 03 (10 years ago)
The Aaron
Pro
API Scripter
Hmm. Can you post a failing code sample? I feel like this has worked for me in the past, but I ca't swear to it...
March 03 (10 years ago)

Edited March 03 (10 years ago)
Sure, here's a simple test script. Be sure to create a rollable table called "TestTable" with a couple values in it.

on("chat:message", function(msg) {
if (msg.type == "api" && msg.content.indexOf("!test") != -1) {
sendChat(msg.who, "[[1t[TestTable]]]");
}
});
I thought the syntax was wrong at first, but if I put [[1t[TestTable]]] in chat it displays a random value just fine, but errors in the API. I've tried on Dev and Prod.

Edit: I'm obviously trying to do something more complicated with the callbacks, but I've boiled the problem down to this as the simplest to reproduce situation.

March 03 (10 years ago)
The Aaron
Pro
API Scripter
Hmm. I'll try this in the morning. Apparently I can't paste scripts from my phone. :/
March 03 (10 years ago)
The Aaron
Roll20 Production Team
API Scripter
I got the same results as you, and some other ones. This appears to be an actual bug. I've escalated it to the Devs.