Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Fix documentation of join() and getRoomState() methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Jun 25, 2018
1 parent 9910da9 commit 45cd71d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -28,7 +28,8 @@ const mp = miniplug({
})

// Join a room
mp.join('tastycat').then((room) => {
mp.join('tastycat').then(() => {
const room = mp.room()
mp.chat(`Hello ${room.name}! :wave:`)
})

Expand Down
14 changes: 9 additions & 5 deletions docs/API.md
Expand Up @@ -273,7 +273,7 @@ mp.use(lotteryPlugin())
```

<a id="mp-join"></a>
## mp.join(room): Promise&lt;[Room](#class-room)>
## mp.join(room): Promise

Join a room. The parameter is the room's slug. If your room URL is
`https://plug.dj/loves-kpop`, the slug is `loves-kpop`.
Expand Down Expand Up @@ -375,11 +375,15 @@ mp.unfavoriteRoom(123456).then(() => {
```

<a id="mp-getroomstate"></a>
## mp.getRoomState(): Promise&lt;[Room](#class-room)>
## mp.getRoomState(): Promise&lt;object>

Get the current room object, but fresh from the plug.dj API and not cached. This
is like an async version of [mp.room()](#mp-room). Using [mp.room()](#mp-room)
should be preferred whenever possible.
Get the current room object, but fresh from the plug.dj API and not cached. It
returns the object from plug.dj's [`/_/rooms/state`][rooms/state] endpoint.

Using other API methods like [mp.room()](#mp-room) should be preferred whenever
possible.

[rooms/state]: https://github.com/plugcommunity/documentation/blob/master/api/endpoints/rooms_state.md

<hr>

Expand Down

0 comments on commit 45cd71d

Please sign in to comment.