Jump to content


Photo

node-steam-user v 4

node.js node-steam-user

Best Answer Ino , 08 January 2019 - 07:35 AM

Are you on the latest v4 commit? That sounds like a bug I fixed a couple weeks ago.

Try to do it. If send one message - this event will be emitted so many times, how much you have accounts. I think the problem with websockets, maybee all accounts connected to one websocket or smth any.

UPDT: Method gamesPlayed() don't work too

OYGg41M.png

const SteamUser = require("./node_modules/node-steam-user-4")

const client1 = new SteamUser()
const client2 = new SteamUser()
client1.logOn({
  accountName: '',
  password: ''
})
client2.logOn({
  accountName: '',
  password: ''
})

client1.on('friendMessage', (senderID, message) => {
  console.log(message)
})

client2.on('friendMessage', (senderID, message) => {
  console.log(message)
})
Go to the full post


  • Please log in to reply
20 replies to this topic

#1 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 25 December 2018 - 04:36 AM

Hi, when do you planning release node-steam-user v 4 ?



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 25 December 2018 - 04:36 AM

No planned date yet.



#3 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 25 December 2018 - 09:25 AM

No planned date yet.

Okay, then can you write documentation for your demo version node-steam-user v4, please ?



#4 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 29 December 2018 - 12:18 PM

No planned date yet.

How does work method getChatMessageHistory ?

When i try to use id i get error TypeError: Cannot read property 'maxCount' of undefined

const option = { maxCount: 1000 }
client.chat.getChatMessageHistory( (id, id, option) ,messages => { console.log(messages) })


#5 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 30 December 2018 - 01:03 AM

  1. You should not be using the same id for the first and second parameters. The first parameter is the group chat ID, and the second is the ID of the channel you're looking for.
  2. Get rid of the parens around the parameters. That's turning the commas into comma operators, which is not what you want to do.


#6 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 30 December 2018 - 02:58 AM

 

  1. You should not be using the same id for the first and second parameters. The first parameter is the group chat ID, and the second is the ID of the channel you're looking for.
  2. Get rid of the parens around the parameters. That's turning the commas into comma operators, which is not what you want to do.

 

My bad, sorry. How can I get chat history with my friend? And how can I find out about group id and chat id to get history with my friend? I thought that i need to use a friend’s steamID64 as before

i have tried to using this method but every time i get null

https://github.com/D...chatroom.js#L77

client.chat.getGroups( groups => { console.log(groups) } ) // groups = null

Edited by Ino, 30 December 2018 - 03:06 AM.


#7 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 30 December 2018 - 03:20 AM

 

My bad, sorry. How can I get chat history with my friend? And how can I find out about group id and chat id to get history with my friend? I thought that i need to use a friend’s steamID64 as before

i have tried to using this method but every time i get null

https://github.com/D...chatroom.js#L77

client.chat.getGroups( groups => { console.log(groups) } ) // groups = null

 

 

As in all callbacks, the first argument is err. And I'm pretty sure you'd want to still use getChatHistory as before.



#8 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 30 December 2018 - 03:26 AM

As in all callbacks, the first argument is err. And I'm pretty sure you'd want to still use getChatHistory as before.

getChatHistory works bad because with time chat history lost and i want to try get history through new method.
Can you tell me how can i get chat id and group id for get chat history with my friend ?



#9 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 30 December 2018 - 03:48 AM

Chat history is temporary for all chats, even group chats.

 

EWUEr.png



#10 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 30 December 2018 - 05:53 AM

Chat history is temporary for all chats, even group chats.

 

EWUEr.png

Okay, but how can i get chat_id & group_id for send message for example ?



#11 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 31 December 2018 - 01:04 AM

getGroups



#12 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 31 December 2018 - 03:36 AM

getGroups

When i called this i get an empty object every time

client.chat.getGroups( (err, groups) => { console.log(groups.chat_room_groups) } ) // Object {}


#13 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 31 December 2018 - 04:04 AM

You probably aren't in any groups.



#14 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 31 December 2018 - 04:57 AM

You probably aren't in any groups.

But i have friends, how can i send message them using this method ?
SteamChatRoomClient
.prototype.sendChatMessage = function(groupId, chatId, message, callback) {})



#15 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 31 December 2018 - 03:20 PM

You don't, you use sendFriendMessage.


  • Ino likes this

#16 byteframe

byteframe

    Member

  • Member
  • PipPip
  • 25 posts

Posted 01 January 2019 - 01:03 AM

oh boy I can play with the new chat stuff? can I install this branch with npm?

 

edit: nvm I got it installed, now I can get a jump on updating my code.


Edited by byteframe, 01 January 2019 - 01:13 AM.


#17 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 01 January 2019 - 04:00 AM

You don't, you use sendFriendMessage.

Thank you, i have last question. How can i send link like in steam ? What's options i need provide ?

https://gyazo.com/10...8031bf00b26c388

And how can i handle new messages from my friends ? In the new version if i use 2 accounts - event friendMessage emited 2 times. Int the old version it work normally, but version 4 emit that event as many times as I have accounts


Edited by Ino, 01 January 2019 - 08:23 AM.


#18 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 01 January 2019 - 04:41 PM

Are you on the latest v4 commit? That sounds like a bug I fixed a couple weeks ago.



#19 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 02 January 2019 - 08:45 AM

Are you on the latest v4 commit? That sounds like a bug I fixed a couple weeks ago.

Yes, I even downloaded again just the same error



#20 Ino

Ino

    Advanced Member

  • Member
  • PipPipPip
  • 63 posts

Posted 06 January 2019 - 10:57 AM

Are you on the latest v4 commit? That sounds like a bug I fixed a couple weeks ago.

 

Yes, I even downloaded again just the same error

Can you help me with this issue ?







Also tagged with one or more of these keywords: node.js, node-steam-user

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users