Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const SteamUser = require('steam-user')
- const TradeOfferManager = require('steam-tradeoffer-manager');
- const SteamCommunity = require('steamcommunity');
- const SteamTotp = require('steam-totp');
- const fs = require('fs');
- const request = require('request');
- const community = new SteamCommunity();
- const client = new SteamUser();
- const manager = new TradeOfferManager({
- steam: client,
- domain: 'Profit.gg',
- language: 'en'
- });
- //Things to edit below here
- const editables = {
- accountInfo:{
- sharedSecret: 'aIqcagFaSXaebGlrN/zK3gjlUWE=', //Shared secret .MA file from the desktop auth
- identitySecret: 'r0kIcnhi3xA8Prek/dj5kbANzxc=', //Identity secret from .ma file
- userName: 'USERNAME', //Username to login WITH
- password: 'PASSWORD', //Password to login WITH
- adminID: ['76561198381836066'], //AdminID, will be used to accept/send messages from/to adminID can have multiple admins Owner needs to be in both
- ownerID: '76561198381836066', //Decided to be lazy and do it this way, this will make sure you receive updates on the bot only 1 owner
- botName: "Snow", //What you want your bot name to show as on steam-user
- game: 'R.I.P MY VAC. BOT SAYING', //What game you are playing
- },
- Messages:{
- donation: 'Thank you for the donation!', //Message sent to user when a donation is received.
- declinedMsg: 'Sorry cannot accept this trade since you requested one of my items.',
- acceptedFriend: 'Thanks for adding me, to get started just send me a trade with the items you want to donate.', //Message for new friends
- newDonation: 'I have received a new donation, please withdraw it from my account by sending me a trade.', //Message for new donations
- unknown: 'Error: Unknown command, type !commands if you want to see the list of commands.' //Message for unknown commands
- },
- commands:{
- '!help': 'To donate items send the item(s) to me, for me to accept I cannot be giving anything.',
- '!creator': 'Steam: Snow',
- '!commands': '!help, !creator, !owner, !aboutkara',
- '!owner': 'Here Is The Owner Of This Bot -> http://steamcommunity.com/id/costanzacsgo.',
- '!aboutkara': ':)',
- '!age': 'Ask Her :)',
- '!link': 'http://steamcommunity.com/id/costanzacsgo',
- '!rank': ':)',
- '!country': 'United Kingdom , She Is A Great British',
- '!birthday': "11-Sep-2001",
- '!living in': 'Top Secret. You Can Ask Her(Kara) :D',
- '!gender': 'Female'
- }
- };
- /*
- const logOnOptions = {
- accountName: editables.accountInfo.userName,
- password: editables.accountInfo.password,
- twoFactorCode: SteamTotp.generateAuthCode(editables.accountInfo.sharedSecret)
- };
- client.logOn(logOnOptions);
- client.on('loggedOn', () => {
- console.log("You are logged in as: " + editables.accountInfo.botName);
- client.setPersona(SteamUser.Steam.EPersonaState.Online, editables.accountInfo.botName);
- client.gamesPlayed(editables.accountInfo.game);
- })
- client.on("friendMessage", function(steamID, message){
- if(message == "!aboutkara"){
- client.chatMessage(steamID, "!age");
- client.chatMessage(steamID, "!link");
- client.chatMessage(steamID, "!rank");
- client.chatMessage(steamID, "!gender");
- client.chatMessage(steamID, "!country");
- client.chatMessage(steamID, "!birthday");
- client.chatMessage(steamID, "!living in");
- }
- });
- client.on("friendMessage", function(steamID, message){
- if(message == "!rank"){
- client.chatMessage(steamID, "Skills Rank:The Global Elite.");
- client.chatMessage(steamID, "Current Rank:Legendary Eagle Master.");
- }
- });
- client.on('webSession', (sessionid, cookies) => {
- manager.setCookies(cookies);
- community.setCookies(cookies);
- community.startConfirmationChecker(10000, editables.accountInfo.identitySecret);
- });
- function isInArray(value, array) {
- return array.indexOf(value) > -1;
- }
- client.on('friendRelationship', (steamid, relationship) => {
- if(relationship == 2){
- client.addFriend(steamid);
- client.chatMessage(steamid, editables.Messages.acceptedFriend);
- }
- });
- client.on('friendMessage', (steamid, message) => {
- console.log('New message from: ' +steamid + ' Saying: ' +message);
- console.log(editables.commands[message]);
- if(editables.commands[message]){
- client.chatMessage(steamid, editables.commands[message]);
- }
- else{
- client.chatMessage(steamid, editables.Messages.unknown);
- }
- });
- function accept(offer){
- offer.accept((err) => {
- if(err) console.log('Unable to accept offer: ${err.message}');
- community.checkConfirmations();
- });
- }
- function decline(offer){
- offer.decline((err) => {
- if(err) return console.log('Unable to decline offer: ${err.message}');
- });
- }
- manager.on('newOffer', (offer) =>{
- const partnerID = offer.partner.getSteamID64();
- console.log('New offer: ' + offer.id + ' from: ' + partnerID);
- if(isInArray(partnerID, editables.accountInfo.adminID)){
- console.log('Accepting offer from admin!');
- client.chatMessage(editables.accountInfo.ownerID, 'New admin offer from: ' + partnerID);
- accept(offer);
- } else if(!offer.itemsToGive.length) {
- console.log('New donation from: ' + partnerID);
- client.chatMessage(partnerID, editables.Messages.donation);
- client.chatMessage(editables.accountInfo.ownerID, editables.Messages.newDonation);
- accept(offer);
- }
- else {
- console.log('Declining offer from: ' + partnerID);
- client.chatMessage(partnerID, editables.Messages.declinedMsg);
- decline(offer);
- }
- });
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement