Jump to content
McKay Development

Recommended Posts

Posted

I am trying to build a basic group chat bot. At the moment it looks like this..

var User = require('steam-user')
var bot = new User()

bot.logOn({
  'accountName': process.env.USERNAME,
  'password': process.env.PASSWORD
})

bot.on('loggedOn', function (res) {
  console.log('Logged in!')
  console.log(res)
  bot.setPersona(User.EPersonaState.Online)
})

bot.on('webSession', function (sessionID, cookies) {
  console.log('Got a web session!')
})

bot.on('friendMessage', function (steamID, message) {
  console.log(`message from ${steamID.getSteam3RenderedID()}: ${message}`)
})

bot.on('chatInvite', function (inviterID, chatroomID) {
  bot.joinChat(chatroomID, function (eresult) {
    console.log(eresult)
  })
})

bot.on('error', function (e) {
  console.log(e)
})

The call to the joinChat method is successful but the EResult is a 7 - "InvalidProtocolVer". I've been searching for information about how to handle this type of error and was hoping that maybe someone here has encountered it before.

Posted (edited)

Bummer. I've tried clearing npm cache, and even reinstalling Node. I think I'm going to try pushing to a remote and see if there isn't just something stupid happening with my local environment.

 

EDIT: I've now tried the same script on a fresh DigitalOcean droplet and I still get InvalidProtocolVer trying to join a chat.

 

FINAL EDIT: Well this is embarrassing..

 

I tried the above script with my own credentials and it worked! So I started investigating differences between my account, and the bot account.

Which ultimately led me to this. I was receiving the error because the bot was a limited user.

 

I added funds to its Steam wallet and it works as expected.

Edited by snowcrash

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...