Added support for new game objects (#332)

bot.setStreaming(name, url, type, callback); added
logic for Internal setStatus updated to check if string or object
This commit is contained in:
Brussell
2016-05-08 11:47:22 -05:00
committed by abalabahaha
parent 42fd07c5e7
commit 0c38d47ef6
5 changed files with 24 additions and 7 deletions

View File

@@ -1094,6 +1094,10 @@ export default class Client extends EventEmitter {
return this.setStatus(null, game, callback);
}
setStreaming(name, url, type, callback = (/*err, {}*/) => { }) {
return this.setStatus(null, {name: name, url: url, type: type}, callback);
}
//def forceFetchUsers
forceFetchUsers(callback){
return this.internal.forceFetchUsers().then(callback);

View File

@@ -1166,9 +1166,7 @@ export default class InternalClient {
this.idleStatus = this.idleStatus || null; //undefined
}
this.game = game === null ? null : !game ? this.game || null : {
name: game
};
this.game = game === null ? null : !game ? this.game || null : typeof game === "string" ? {name: game} : game;
var packet = {
op: 3,