Closed chmac closed 6 months ago
I would expect that calling roller.roll() on a section roller should return a string, but it returns an object.
roller.roll()
const diceRollerPlugin = app.plugins.getPlugin('obsidian-dice-roller') const manifestoRoller = await diceRollerPlugin.getRoller('[[Quotes]]') const section = await manifestoRoller.roll() console.log(JSON.stringify(section))
This outputs a JSON object like so:
{ "type": "paragraph", "position": { "start": { "line": 9, "col": 0, "offset": 66 }, "end": { "line": 10, "col": 10, "offset": 88 } }, "id": "dice-j5v2" }
Reproduction posted above.
1.4.16
10.4.0
No response
This is expected behavior, but you can use SectionRoller#transformResultsToString to get a string result.
SectionRoller#transformResultsToString
@valentine195 Aha, thanks for sharing the way to resolve a string, I couldn't figure that out. 👍🏼
Check for existing bug reports before submitting.
Expected Behavior
I would expect that calling
roller.roll()
on a section roller should return a string, but it returns an object.Current behaviour
This outputs a JSON object like so:
Reproduction
Reproduction posted above.
Which Operating Systems are you using?
Obsidian Version Check
1.4.16
Plugin Version
10.4.0
Confirmation
Possible solution
No response