Jump to content
McKay Development

Recommended Posts

Posted

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:
 
 

// Requires
var 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');
 
// Objects
var 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

Posted

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?

  • 2 weeks later...
Posted

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.

Posted

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)?

  • 2 weeks later...

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...