Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const SteamUser = require('steam-user');
- const SteamTotp = require('steam-totp');
- const SteamCommunity = require('steamcommunity');
- const TradeOfferManager = require('steam-tradeoffer-manager');
- const config = require('./config.json');
- const client = new SteamUser();
- const community = new SteamCommunity();
- const manager = new TradeOfferManager ({
- steam: client,
- community: community,
- language: 'en'
- });
- const logOnOptions = {
- accountName: config.username,
- password: config.password
- twoFactorCode: SteamTotp.generateAuthCode("")
- };
- client.logOn(logOnOptions);
- client.on('loggedOn', () => {
- console.log('succesfully logged on.');
- client.setPersona(SteamUser.Steam.EPersonaState.Online);
- client.gamesPlayed(440);
- client.gamesPlayed(["15 days Trade Ban"]);
- });
- client.on("friendMessage", function(steamID, message) {
- if (message == "!help") {
- client.chatMessage(steamID, "Commands:");
- client.chatMessage(steamID, "!owner - show my owner profile, if you have any problems you may contact me!");
- client.chatMessage(steamID, "");
- client.chatMessage(steamID, "!buygems [amount of sets] - use to buy that amount of sets for gems, following the current BOT rate");
- }
- if (message == "!owner") {
- client.chatMessage(steamID, "There is something wrong?");
- client.chatMessage(steamID, "Let me know if you're experiencing issues with my bot!");
- client.chatMessage(steamID, "https://steamcommunity.com/id/z-fortex/");
- }
- if (message == "!buygems") {
- client.chatMessage(steamID, "Error 404");
- }
- });
- client.on('friendRelationship', function(sid, relationship) {
- if (relationship == SteamUser.EFriendRelationship.RequestRecipient) {
- console.log("We recieved a friend request from "+sid);
- client.addFriend(sid, function (err, name) {
- if (err) {
- console.log(err);
- return;
- }
- console.log("Accepted user with the name of "+name)
- client.chatMessage(sid, "Hey, thanks for add me!, you may type !help for instructions");
- })
- }
- })
- client.on('groupRelationship', function(sid, relationship) {
- if (relationship == SteamUser.EClanRelationship.Invited) {
- console.log("We were asked to join steam group #"+sid);
- client.respondToGroupInvite(sid, true);
- }
- })
- client.on('friendsList', function() {
- for (var sid in client.myFriends);
- var relationship = client.myFriends[sid]
- if (relationship == SteamUser.EFriendRelationship.RequestRecipient) {
- console.log("(offline) We recieved a friend request from "+sid);
- client.addFriend(sid, function (err, name) {
- if (err) {
- console.log(err);
- return;
- }
- console.log("(offline) Accepted user with the name of "+name)
- })
- }
- })
- client.on('groupList', function() {
- for (var sid in client.myGroups);
- var relationship = client.myGroups[sid];
- if (relationship == SteamUser.EClanRelationship.Invited) {
- console.log("(offline) We were asked to join steam group #"+sid);
- client.respondToGroupInvite(sid, true);
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement