Member Posted March 25, 2020 Report Share Posted March 25, 2020 "use strict"; const SteamUser = require("steam-user"); const SteamTotp = require("steam-totp"); const SteamID = require('steamid') const Steamcommunity = require("steamcommunity"); const community = new Steamcommunity(); const client = new SteamUser(); client.logOn(just say i logged); client.on('loggedOn', ()=>{ console.log('logged'); client.setPersona(SteamUser.EPersonaState.Online); client.gamesPlayed(440); }); function isOwner(steamid){ return config.owner.includes(steamid) }; function Command(string){ if (string.startsWith('!')){ const command = string.toLowerCase().split(' ')[0].substr(1); return command; } else { return null; } } client.on('friendMessage', (steamid, message)=>{ message = message.trim(); const SteamID = steamid.getSteamID64(); const command = Command(message); if (command == 'avatar' && isOwner(SteamID)){ const avatarURL = message.substr(message.toLowerCase().indexOf('avatar') + 7); if (avatarURL == ''){ client.chatMessage(SteamID, 'No URL'); } community.uploadAvatar(avatarURL, function(err){ if (err){ client.chatMessage(SteamID, err); } else { client.chatMessage(SteamID, 'Avatar Changed'); } }) } }) why bot always saying Error: not logged in how can i fix it? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted March 25, 2020 Report Share Posted March 25, 2020 You need to call community.setCookies, and you can obtain cookies from the webSession event. Quote Link to comment Share on other sites More sharing options...
Member Posted March 25, 2020 Author Report Share Posted March 25, 2020 1 hour ago, Member said: ok Quote Link to comment Share on other sites More sharing options...
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.