# Game-specific chat commands for Twitch

Build Twitch chat commands for the game you play as Bloopbot flows, such as an Old School RuneScape Grand Exchange price with !ge or a World of Warcraft Raider.IO score with !rio that answers only while you play WoW.

Video: [Chat commands built as flows for the game on stream: !ge answers with an Old School RuneScape Grand Exchange price, and after a switch to World of Warcraft, !rio answers with a Raider.IO Mythic+ score](https://bloopbot.com/videos/game-commands-v1.mp4)

## Old School RuneScape: !ge

A viewer types `!ge twisted bow` and the bot answers with the item's Grand Exchange price, from Weird Gloop's price API at `api.weirdgloop.org`, which needs no key. The flow is six steps:

| Step | Set to |
| --- | --- |
| Chat command | `ge` |
| Web request | GET `https://api.weirdgloop.org/exchange/history/osrs/latest?name=$(query)` |
| Read JSON | Read `$(from.web.text)`, pick `item` ← `*` |
| For each | `$(from.json.item)` |
| Check a value | `$(item.price)` is not empty |
| Chat message | `$(item.key): $(item.price) gp` |

`$(query)` is everything the viewer typed after the command, and the API matches the item's name whatever its capitals, so `!ge twisted bow` answers `Twisted bow: 1356626084 gp`. A name the API doesn't know gets no answer, because **Check a value** stops it. Several names separated by `|`, such as `!ge abyssal whip|dragon claws`, get one line each.

![The !ge flow on the canvas in two rows: Chat command !ge, a Web request to api.weirdgloop.org with the viewer's words as the item name, Read JSON picking every entry as item, For each going through them, Check a value letting only entries with a price through, and a Chat message saying the item's name and price in gp.](https://bloopbot.com/docs/screenshots/game-commands-ge-flow.jpg)

_The !ge flow: Chat command, Web request, Read JSON, For each, Check a value and Chat message._

## World of Warcraft: !rio

`!rio` posts your character's Mythic+ score from Raider.IO, and only while your stream's category is World of Warcraft:

| Step | Set to |
| --- | --- |
| Chat command | `rio` |
| Check a value | `$(data.stream.category)` equals `World of Warcraft` |
| Web request | GET `https://raider.io/api/v1/characters/profile?region=eu&realm=your-realm&name=YourCharacter&fields=mythic_plus_scores_by_season:current` |
| Read JSON | Read `$(from.web.text)`, pick `score` ← `mythic_plus_scores_by_season.0.scores.all` |
| Chat message | `YourCharacter: $(from.json.score) Mythic+ score on Raider.IO` |

Put your own region, realm and character name in the address. The score comes out with one decimal, as Raider.IO gives it.

## Only while you play it

`$(data.stream.category)` is the category your stream is set to on Twitch, kept up to date as you change it. A **Check a value** step on it keeps a command quiet in any other game, so `!rio` says nothing while you're in RuneScape. Add the same step to `!ge`, set to `Old School RuneScape`, and each game's commands only answer in their own game.

## What you need

- **The Pro plan.** The **Web request** step is part of Pro; the rest of these steps come with every plan. [What your plan includes](https://bloopbot.com/docs/what-your-plan-includes) lists the plans.
- **Web requests allowed.** On the **Flows** page, choose **Web requests: off** so it reads **Web requests: allowed**. It is one switch for your whole channel.
- **A public https address that answers quickly.** A request must answer within 2 seconds, only the first 64 KB of an answer is read, and one run can make two requests.

**Test fire** doesn't reach the game's website: the **Run log** shows the address it would call. Type the command in your own chat to see the real answer.
