How to use bflist in a Twitch bot chat command#
In addition to the below examples, you can find a collection of various commands/examples (ranging from basic to quite complex) here.
There now is a much easier way of using bflist for Twitch chat
statbits.io provides an even easier way of adding commands using bflist data to your chatbot of choice. Using their super simple, graphical command builder you get your command set up in just a few minutes.
Streamlabs example#
Command example (as shown above)
[name] currently has {readapi.https://api.bflist.io/bf2/v1/players/[name]/score}
Nightbot example#
Simple command example (as shown above)
[name] currently has $(urlfetch https://api.bflist.io/bf2/v1/players/[name]/score) points
Advanced command example (using multiple properties and handling errors)
$(eval const response = `$(urlfetch json https://api.bflist.io/bf4/v1/players/__NAME__)`; try { const player = JSON.parse(response); `$(channel) is ${player.kills}/${player.deaths} right now` } catch (e) { `Sorry, could not fetch $(channel)'s current k/d` })
Moobot example#
Streamelements example#
Command example (as shown above)
[name] currently has ${customapi.https://api.bflist.io/bf2/v1/players/[name]/score} points