Advertisement
Magnamura_de

Untitled

Feb 14th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const BeamClient = require('beam-client-node');
  2. const BeamSocket = require('beam-client-node/lib/ws');
  3.  
  4. const ChannelName = "Magnamura";
  5.  
  6. const client = new BeamClient();
  7. client.use(_Username, _Password {
  8.     username: _Username,
  9.     password: _Password,
  10. })
  11. .attempt().then(function)(){
  12.     .request('GET', 'channels/'+ChannelName).then(res => {
  13.         const ChannelID = res.body.id;
  14.     })
  15. }
  16. .then(function () {
  17.     return client.chat.join(ChannelID);
  18. })
  19. .then(function (res) {
  20.     console.log('join chat response:', res);
  21. })
  22. .catch(function (err) {
  23.     console.log('error joining chat:', err);
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement