Skip to content

Instantly share code, notes, and snippets.

@fs-c
Last active August 1, 2017 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fs-c/3b7142f4ec40a7190e870cac54a88dea to your computer and use it in GitHub Desktop.
Save fs-c/3b7142f4ec40a7190e870cac54a88dea to your computer and use it in GitHub Desktop.
const SteamUser = require('steam-user') // npm install steam-user
const MSG = `Default message.`
const ACCOUNT = {
accountName: '',
password: ''
}
let client = new SteamUser()
client.logOn(ACCOUNT)
client.on('loggedOn', details => {
console.log(`Logged on with ${client.steamID.getSteamID64()}.`)
client.setPersona(SteamUser.EPersonaState.Online)
client.on('friendMessage', (id, msg) => {
console.log(`${id.getSteamID64()}: ${msg}`)
client.chatMessage(id, MSG)
})
client.on('error', (err) => console.log(`Error: ${err.message}.`))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment