Constructor
new DotaBot(steamClient, steamUser, steamFriends, dotaClient, config)
Constructor of the DotaBot. This prepares an object for connecting to Steam and the Dota2 Game Coordinator.
Parameters:
Name | Type | Description |
---|---|---|
steamClient |
external:steam.SteamClient | A SteamClient instance. |
steamUser |
external:steam.SteamUser | A SteamUser instance. |
steamFriends |
external:steam.SteamFriends | A SteamFriends instance. |
dotaClient |
external:Dota2.Dota2Client | A Dota2Client instance. |
config |
module:db.Bot | Bot configuration object. |
Extends
Members
Methods
async connect()
Initiates the connection to Steam and the Dota2 Game Coordinator.
async disconnect()
Disconnect from the Game Coordinator. This will also cancel all queued operations!
async inviteToLobby(steamId64)
Invites the given steam id to the Dota lobby.
Parameters:
Name | Type | Description |
---|---|---|
steamId64 |
string | A steam id. |
async joinPracticeLobby(dotaLobbyId)
Join the lobby by dota lobby id.
Parameters:
Name | Type | Description |
---|---|---|
dotaLobbyId |
string | A dota lobby id. |
async logOnToSteam()
Log on to steam. Set online state and display name.
async onSteamClientError()
Steam client error handler. Attempts to connect to steam and connect to Dota
async onSteamClientLoggedOff()
Steam client logged off handler. Attempts to log on to steam and connect to Dota
async practiceLobbyKick(accountId)
Kick the given account id from the lobby.
Parameters:
Name | Type | Description |
---|---|---|
accountId |
number | An account id. |
async practiceLobbyKickFromTeam(accountId)
Kick the given account id from the lobby team slots.
Parameters:
Name | Type | Description |
---|---|---|
accountId |
number | An account id. |
schedule()
Schedule a function for execution. This function will be executed as soon as the GC is available.