describe('#setMyCommands', function setMyCommandsSuite() { it('should set bot commands', function test() { const opts = [ { command: 'eat', description: 'Command for eat' }, { command: 'run', description: 'Command for run' } ]; return bot.setMyCommands(opts).then(resp => { assert.ok(is.boolean(resp)); }); }); });
describe('#getWebHookInfo', function getWebHookInfoSuite() { before(function before() { utils.handleRatelimit(bot, 'getWebHookInfo', this); }); it('should return WebhookInfo', function test() { return bot.getWebHookInfo().then(resp => { assert.ok(is.object(resp)); assert.ok(is.boolean(resp.has_custom_certificate)); assert.ok(is.number(resp.pending_update_count)); }); }); });
describe('#getStickerSet', function getStickerSetSuite() { before(function before() { utils.handleRatelimit(bot, 'getStickerSet', this); }); it('should get the sticker set given the name of the set', function test() { return bot.getStickerSet(STICKER_SET_NAME).then(resp => { assert.ok(is.object(resp)); assert.equal(resp.name.toLowerCase(), STICKER_SET_NAME); assert.ok(is.string(resp.title)); assert.ok(is.boolean(resp.contains_masks)); assert.ok(is.array(resp.stickers)); }); }); });
describe('#setGameScore', function setGameScoreSuite() { before(function before() { utils.handleRatelimit(bot, 'setGameScore', this); }); it('should set GameScore', function test() { const score = Math.floor(Math.random() * 1000); const opts = { chat_id: GAME_CHAT_ID, message_id: GAME_MSG_ID, force: true }; return bot.setGameScore(USERID, score, opts).then(resp => { assert.ok(is.object(resp) || is.boolean(resp)); }); }); });
describe.skip('#setChatAdministratorCustomTitle ', function setChatAdministratorCustomTitleSuite() { it('should set chat permissions', function test() { return bot.setChatAdministratorCustomTitle(GROUPID, USERID, 'Custom Name').then(resp => { assert.ok(is.boolean(resp)); }); }); });
describe('#setChatPermissions ', function setChatPermissionsSuite() { it('should set chat permissions', function test() { const ChatPermissions = { can_send_messages: true, can_send_media_messages: true, can_send_polls: false, can_send_other_messages: false, can_add_web_page_previews: true, can_change_info: false, can_invite_users: false, can_pin_messages: true }; return bot.setChatPermissions(GROUPID, ChatPermissions).then(resp => { assert.ok(is.boolean(resp)); }); }); });
isLeaf() { var leaf = this.getData(this.props.leafProp); if (is.boolean(leaf)) { return leaf; } return !this.hasChildNode(); }
render() { var data = this.state.data || this.props.data, definedRootDisplay = is.boolean(this.props.rootDisplay), rootDisplay = definedRootDisplay ? this.props.rootDisplay : true, treeNodeConfig = Object.assign(this.props.treeNodeConfig || {}, {