I’m trying to make a custom command with the pattern ‘weather set ’ but I keep running into issues with json-as not being able to deserialize or serialize anything.
Error: Could not deserialize data {"Keyword":{"value":"stormy"}} to type WeatherSet. Make sure to add the correct decorators to classes.
namespace CmdArgs { @json export class WeatherSet { @alias("Keyword") keyword: FieldValue.Keyword = new FieldValue.Keyword(); } }
I followed the custom command examples in the v1.65.0 release and on GitHub. I messed around with the field’s capitalization and tried using FieldValue.Text or FieldValue.Keyword. At this point I’m considering just splitting the string by quotation marks - as hacky as that is.
Thanks, Acci! I also ran into a problem with using my management token. I tried building 2 scripts to 2 different rooms and I got an error saying my token was invalid or expired.
If you’re working on the Test Realm, your token will expire the next time it’s copied over from the main Wolfery Realm, best bet is to get a token from Wolfery proper and then you can use the same token on the Test Realm the next time it’s copied.
Thanks. I finally got it to work. It seems on my machine if it uses the api url in the config I get ‘api service unavailable’ but works fine if I pass it as a command flag. And it doesn’t seem to recognize my token in my environment variables.