Class: Bot

Bot

new Bot(username, password, details, settings, logger)

Create a new bot instance
Parameters:
Name Type Description
username
password
details
settings
logger
Source:

Methods

addPhoneNumber(phoneNumber, callbackErrorOnly)

Add a phone-number to the account (For example before setting up 2-factor authentication)
Parameters:
Name Type Description
phoneNumber Certain format must be followed
callbackErrorOnly callbackErrorOnly A callback returned with possible errors
Source:

changeName(newName, namePrefix, callbackErrorOnly)

Change the display name of the account (with prefix)
Parameters:
Name Type Description
newName String The new display name
namePrefix String The prefix if there is one (Nullable)
callbackErrorOnly callbackErrorOnly A callback returned with possible errors
Deprecated:
  • Yes
Source:

fromIndividualAccountID() → {Error|String}

Fetch SteamID Object from the SteamID2, SteamID3, SteamID64 or Tradeurl.
Deprecated:
  • Yes
Source:
Returns:
Type
Error | String

getAccountName() → {String}

Get the account's username, used to login to Steam
Source:
Returns:
username
Type
String

getDisplayName() → {String|undefined}

Get the display name of the account
Source:
Returns:
displayName - Display name of the account
Type
String | undefined

getInventory(appid, contextid, tradableOnly, inventoryCallback)

Retrieve account inventory based on filters
Parameters:
Name Type Description
appid Integer appid by-which to fetch inventory based on.
contextid Integer contextid of lookup (1 - Gifts, 2 - In-game Items, 3 - Coupons, 6 - Game Cards, Profile Backgrounds & Emoticons)
tradableOnly Boolean Items retrieved must be tradable
inventoryCallback inventoryCallback Inventory details (refer to inventoryCallback for more info.)
Deprecated:
  • Yes
Source:

getRateLimited() → {Boolean}

Get if the API/account is rate limited by SteamAPI
Source:
Returns:
rateLimited
Type
Boolean

getUser() → {Error|String}

Fetch SteamID Object from the SteamID2, SteamID3, SteamID64 or Tradeurl.
Source:
Returns:
Type
Error | String

getUserInventory(steamID, appid, contextid, tradableOnly, inventoryCallback)

Retrieve account inventory based on filters and provided steamID
Parameters:
Name Type Description
steamID SteamID SteamID to use for lookup of inventory
appid Integer appid by-which to fetch inventory based on.
contextid Integer contextid of lookup (1 - Gifts, 2 - In-game Items, 3 - Coupons, 6 - Game Cards, Profile Backgrounds & Emoticons)
tradableOnly Boolean Items retrieved must be tradableOnly
inventoryCallback inventoryCallback Inventory details (refer to inventoryCallback for more info.)
Deprecated:
  • Yes
Source:

loggedInAccount(cookies, sessionID, callbackErrorOnly)

This is a private method - but incase you would like to edit it for your own usage...
Parameters:
Name Type Description
cookies Cookies sent by Steam when logged in
sessionID Session ID as sent by Steam
callbackErrorOnly callbackErrorOnly If encountered error (optional)
Source:

setChatting(chattingUserInfo)

Set the user we are chatting with
Parameters:
Name Type Description
chattingUserInfo * | Object
Source:

setRateLimited() → {Boolean}

Get if the API/account is rate limited by SteamAPI
Source:
Returns:
rateLimited
Type
Boolean

verifyPhoneNumber(code, callbackErrorOnly)

Enter the code to verify the phone number.
Parameters:
Name Type Description
code
callbackErrorOnly callbackErrorOnly A callback returned with possible errors
Source:

Events

chatMessage

Emitted when a friend message or chat room message is received.
Type:
  • object
Properties:
Name Type Description
senderID SteamID The message sender, as a SteamID object
message String The message text
Source:

loggedIn

Emitted when we fully sign into Steam and all functions are usable.
Source:

newOffer

Emitted when we receive a new trade offer
Type:
  • object
Properties:
Name Type Description
offer TradeOffer The offer's details
Source:

offerChanged

Emitted when a trade offer changes state (Ex. accepted, pending, escrow, etc...)
Type:
  • object
Properties:
Name Type Description
offer TradeOffer The new offer's details
oldState TradeOffer The old offer's details
Deprecated:
  • Yes
Source:

offerList

Emitted when we fetch the offerList
Type:
  • object
Source:

sentOfferChanged

Emitted when a trade offer changes state (Ex. accepted, pending, escrow, etc...)
Type:
  • object
Properties:
Name Type Description
offer TradeOffer The new offer's details
oldState TradeOffer The old offer's details
Source:

tradeOffers

Emitted when a trade offer is cancelled
Type:
  • object
Properties:
Name Type Description
count Integer The amount of active trade offers (can be 0).
Source:

tradeOffers

Emitted when a trade offer is cancelled
Type:
  • object
Properties:
Name Type Description
count Integer The amount of active trade offers (can be 0).
Source:

tradeOffers

Emitted when a trade offer is cancelled
Type:
  • object
Properties:
Name Type Description
count Integer The amount of active trade offers (can be 0).
Source:

tradeOffers

Emitted when we receive a new trade offer notification (only provides amount of offers and no other details)
Type:
  • object
Properties:
Name Type Description
count Integer The amount of active trade offers (can be 0).
Source: