Guest Tobi3944 Posted August 24, 2020 Report Posted August 24, 2020 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 Quote
Dr. McKay Posted August 24, 2020 Report Posted August 24, 2020 The friendMessage event you're using is deprecated and you should use the SteamChatRoomClient version instead, but that should still work and I don't really see any reason why it wouldn't. What kind of behavior are you seeing and what console output are you getting? Quote
GrassWarlock Posted December 30, 2021 Report Posted December 30, 2021 On 8/25/2020 at 1:05 AM, Dr. McKay said: The friendMessage event you're using is deprecated and you should use the SteamChatRoomClient version instead, but that should still work and I don't really see any reason why it wouldn't. What kind of behavior are you seeing and what console output are you getting? but the friendMessage event is exactly the same name as the one in SteamChatRoomClient, no? Quote
Dr. McKay Posted December 31, 2021 Report Posted December 31, 2021 The events have the same name, yes. 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.