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

Export live character sheet data to Discord bot

1651043872

Edited 1651044521
Hi all,  I wanted to ask if it was possible to have a script that grants access to live character sheet data for the purposes of using that information for a Discord bot. I am currently in a Stars Without Number game hosted on a Discord server. Many of us enjoy roleplaying in text channels between games. Sometimes, however, we would like to make rolls using our character sheets. I was curious if there was a way to stream character sheet data to a Discord bot that could perform these rolls for us.  From what I've read about the API, scripts only run when there is at least one member signed into the game. However, updating character sheet data upon the first sign-in, as well as periodically and/or running a function from Roll20 or the bot would be more than good enough.  This would be my first time creating a Discord bot as well as the first time I'd write a Roll20 script. However, I'm quite proficient with programming. I'd love to know if (a) this is possible, and (b) if it is, then what possible directions I could take to pursue this.  Thanks! 
1651072650
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
API scripts are restricted to only affecting things in the game itself. What you want needs either a custom browser extension or a script running on your computer.
Scott C. said: API scripts are restricted to only affecting things in the game itself. What you want needs either a custom browser extension or a script running on your computer. Gotcha, thanks! I'll check out some other options then
You could just have each character create a Handout with a copy of their character sheet.  There are many editors online that can convert character sheets to html.  From there set the permissions of your game so it can be opened remotely.  You might even be able to create a discord bot to open specific character sheet URLS based on the user in discord.  Hell, it might even be possible to link directly to a character sheet in discord. Example: !Sheet DISCORD_USERNAME Output: Discord Posts a link or whispers a link of the requested character sheet handout page. But how to do that sort of BOT on discord I've no idea.  I've heard BoTs arent terribly difficult to make, but I've never tried.  From your original post, it seems that you might be able to do this.  But it is contingent on Discord Bots being able to store some basic information assigned by users, roll20 links being fixed and unchanging over a period of time and the level security both discord/roll20 has. If you only need this running while the game is active, you might also be able to create a rolltemplate that gives basic character details using token select then capturing the output of that chat window.  But that would likely require a dummy account and a way to clear chat after each whisper.  I dont know how feasible that is. An alternate methods is create an API that exports the character sheet to a CSV or json and create a discord bot to read that sheet and link that sheet to an assigned discord user, much like my previous suggestion.  Unlike the previous idea, a discord bot would then parse the saved text as a "character sheet."