Jump to content
McKay Development

I am having trouble getting SteamChatRoomClient to work


Recommended Posts

Hi, I have been trying to send a message using the SteamChatRoomClient stuff (since it seems that the other one is deprecated)

This is the code that I use:

(in bot file)

const steamUser = require('steam-user');
const client = new steamUser();

module.exports.client = client;

client.on("friendMessage", function (steamID, message)
{
    chatHandler.chatManager(steamID, message);
});

(In chatHandler file)

const bot = require('./bot.js');
const config = require('./config.json');


module.exports.chatManager = chatManager;

function chatManager(steamID, message)
{
    console.log(bot.client.steamID);
    console.log("before switch statement");

    let steam3ID = '"[U:' + steamID.type + ":" + steamID.accountid + ']"';

    switch (true)
    {
        case (/test/i.test(message)):
            bot.client.chat.sendFriendMessage(steam3ID, "Hello World");
            break;
    };
};

(please note that I have removed some cases from the switch statement & stuff that I dont think have anything to do with this)*

Thanks in advance,

Tobi

Dont need this post anyways, just realised that I needed to just use steamID... The example at the top threw me a bit off :D

Link to post
Share on other sites

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