zephylac Posted June 15, 2016 Report Posted June 15, 2016 Hi, Today I found this awesome extansion I tried to use it. I implemented it in my codes Here's my problem: I want to get a message from a friend so I did: advFriend.on('friendMessage', function(steamID, message) { console.log("Friend message from " + steamID.getSteam3RenderedID() + ": " + message); }); But when I send message to my bot, nothing appears in my console.Here's how I defined it before: // Requiresvar Steam = require("steam"),SteamGroups = require("steam-groups"),storage = require('node-persist'),util = require("util"),fs = require("fs"),csgo = require("../"),readlineSync = require("readline-sync"),crypto = require("crypto"),AdvSteamUser = require('steam-user'); // Objectsvar bot = new Steam.SteamClient(),steamUser = new Steam.SteamUser(bot),steamFriends = new Steam.SteamFriends(bot),steamGroup = new SteamGroups(bot),steamGC = new Steam.SteamGameCoordinator(bot, 730),CSGOCli = new csgo.CSGOClient(steamUser, steamGC, false),advFriend = new AdvSteamUser(),I can't find the error. I tried several times and solutions. I don't know from where it comes N.B : I don't have any error reports in my console Quote
Dr. McKay Posted June 15, 2016 Report Posted June 15, 2016 You're already using node-steam and its handlers. Use those instead. Don't try to use them alongside node-steam-user. Quote
zephylac Posted June 16, 2016 Author Report Posted June 16, 2016 Ok but my problem is that I want to use yours but the node-steam event friendMessage is triggered when someone is typing but I want it to be trigger when I actually receive a message. SO if I want to use yours I need to remove node-steam? Quote
Dr. McKay Posted June 16, 2016 Report Posted June 16, 2016 Yes, that's your best bet. You can ignore typing events in node-steam by checking the chatEntryType. Quote
zephylac Posted June 16, 2016 Author Report Posted June 16, 2016 Yes thank you I saw that. But I've looked in to it but there is no documentation on type of chatEntryType. I've look around none of it. So how I can distinguish them? Quote
Dr. McKay Posted June 16, 2016 Report Posted June 16, 2016 https://github.com/SteamRE/SteamKit/blob/master/Resources/SteamLanguage/enums.steamd#L14-L32 Quote
zephylac Posted June 16, 2016 Author Report Posted June 16, 2016 I guess I would do that Steam.EChatEntryType.ChatMsg === 1 Quote
greybonez Posted June 26, 2016 Report Posted June 26, 2016 sorry to necro this thread but I have a similar issue when trying to capture the 'friendMessage' event when using steam-user. what I have: var SteamUser = require('steam-user'); // The heart of the bot. We'll write the soul ourselves. var client = new SteamUser(); client.on('friendMessage', function(steamID, message) { console.log("Friend message from " + steamID.getSteam3RenderedID() + ": " + message); }); This is just a snippet of my js file. I do successfully login, create web sessions / cookies etc. but for some reason this event doesn't fire when I send a message to 'client'. I have two steam accounts which I log in to in order to test the friendMessage event. Could the issue be that the accounts are from the same IP? Also, I have confirmed that the messages are sent and received. Quote
Dr. McKay Posted June 26, 2016 Report Posted June 26, 2016 Are you going online on chat properly with client.setPersona? greybonez 1 Quote
greybonez Posted June 26, 2016 Report Posted June 26, 2016 Are you going online on chat properly with client.setPersona? That fixed the issue. Thanks for being so helpful! For my own sanity, how do you know that the client needs to be 'online' in order to receive this message (I didn't see anything in the docs about this)? Quote
Dr. McKay Posted June 26, 2016 Report Posted June 26, 2016 Just my own experience. I've updated the readme to reflect this fact. greybonez 1 Quote
timgfx Posted July 10, 2016 Report Posted July 10, 2016 I see you're using node-csgo. I tried to use it too but can't get it to work! Can you help me? Quote
Recommended Posts
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.