From 45cd71d00e15904680dba76105f27e57934d469e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Mon, 25 Jun 2018 21:34:54 +0200 Subject: [PATCH] Fix documentation of join() and getRoomState() methods. --- README.md | 3 ++- docs/API.md | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6aed8bf..57063e7 100644 --- a/README.md +++ b/README.md @@ -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:`) }) diff --git a/docs/API.md b/docs/API.md index 0429999..9be33e8 100644 --- a/docs/API.md +++ b/docs/API.md @@ -273,7 +273,7 @@ mp.use(lotteryPlugin()) ``` -## mp.join(room): Promise<[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`. @@ -375,11 +375,15 @@ mp.unfavoriteRoom(123456).then(() => { ``` -## mp.getRoomState(): Promise<[Room](#class-room)> +## mp.getRoomState(): Promise<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