- cache
Cache functions
- constants
- db
Database functions
- dotaBot
Dota bot functions
- guild
- ihl
- ihlCommand
- ihlManager
- lobby
- matchTracker
Cache functions
Enum for all constant values.
Kind: static enum of constants
Read only: true
Database functions
External namespace for discord.js classes.
Kind: inner external of db
Category: Sequelize
See: http://docs.sequelizejs.com/
Kind: static class of sequelize
Category: Sequelize
See: http://docs.sequelizejs.com/class/lib/model.js~Model.html
External Sequelize Model class.
Dota bot functions
- dotaBot
- ~DotaBot ⇐
EventEmitter
- new DotaBot(steamClient, steamUser, steamFriends, dotaClient, config)
- .teamCache ⇒
object
- .teamCache
- .steamId64 ⇒
string
- .lobby ⇒
object
- .dotaLobbyId ⇒
Long
- .playerState ⇒
object
- .lobbyChannelName ⇒
string
- .accountId ⇒
number
- .state ⇒
string
- .rateLimit ⇒
number
- .rateLimit
- .backoff ⇒
number
- .backoff
- .schedule()
- .block()
- .release()
- .clear()
- .onSteamClientLoggedOff()
- .onSteamClientError()
- .onDotaReady()
- .onDotaUnready()
- .connect()
- .logOnToSteam()
- .connectToDota()
- .disconnect()
- .inviteToLobby(steamId64)
- .practiceLobbyKickFromTeam(accountId)
- .practiceLobbyKick(accountId)
- .joinPracticeLobby(dotaLobbyId)
- ~slotToTeam(slot) ⇒
number
- ~updatePlayerState(steamId64, slot, playerState) ⇒
Object
- ~isDotaLobbyReady(teamCache, playerState) ⇒
boolean
- ~startDotaLobby(dotaBot) ⇒
string
- Other
- node-dota2
- node-steam
- ~DotaBot ⇐
dotaBot~DotaBot ⇐ EventEmitter
Class representing a Dota bot. Handles all in game functions required to host an inhouse lobby.
Kind: inner class of dotaBot
Extends: EventEmitter
- ~DotaBot ⇐
EventEmitter
- new DotaBot(steamClient, steamUser, steamFriends, dotaClient, config)
- .teamCache ⇒
object
- .teamCache
- .steamId64 ⇒
string
- .lobby ⇒
object
- .dotaLobbyId ⇒
Long
- .playerState ⇒
object
- .lobbyChannelName ⇒
string
- .accountId ⇒
number
- .state ⇒
string
- .rateLimit ⇒
number
- .rateLimit
- .backoff ⇒
number
- .backoff
- .schedule()
- .block()
- .release()
- .clear()
- .onSteamClientLoggedOff()
- .onSteamClientError()
- .onDotaReady()
- .onDotaUnready()
- .connect()
- .logOnToSteam()
- .connectToDota()
- .disconnect()
- .inviteToLobby(steamId64)
- .practiceLobbyKickFromTeam(accountId)
- .practiceLobbyKick(accountId)
- .joinPracticeLobby(dotaLobbyId)
Constructor of the DotaBot. This prepares an object for connecting to Steam and the Dota2 Game Coordinator.
Param | Type | Description |
---|---|---|
steamClient | SteamClient |
A SteamClient instance. |
steamUser | SteamUser |
A SteamUser instance. |
steamFriends | SteamFriends |
A SteamFriends instance. |
dotaClient | Dota2Client |
A Dota2Client instance. |
config | module:db.Bot |
Bot configuration object. |
Get the player to team mapping object
Kind: instance property of DotaBot
Returns: object
- The player to team mapping object.
Set the player to team mapping object
Kind: instance property of DotaBot
Param | Type | Description |
---|---|---|
newCache | object |
The new player to team mapping object. |
Get bot steamId64
Kind: instance property of DotaBot
Returns: string
- The bot steam 64 id.
Get the dota lobby object
Kind: instance property of DotaBot
Returns: object
- The current lobby state
dotaBot.dotaLobbyId ⇒ Long
Get the dota lobby id
Kind: instance property of DotaBot
Returns: Long
- The id of the current lobby.
Get the dota lobby player state
Kind: instance property of DotaBot
Returns: object
- The current lobby player state
Get the dota lobby channel name
Kind: instance property of DotaBot
Returns: string
- The channel name of the current lobby.
Get the bot account id
Kind: instance property of DotaBot
Returns: number
- The account id.
Get the current state of the queue
Kind: instance property of DotaBot
Returns: string
- The current state of the queue.
Get the current rate limit factor
Kind: instance property of DotaBot
Returns: number
- The current queue rate limit factor in milliseconds.
Set the rate limiting factor
Kind: instance property of DotaBot
Param | Type | Description |
---|---|---|
rateLimit | number |
Milliseconds to wait between requests. |
Get the current backoff time of the queue
Kind: instance property of DotaBot
Returns: number
- The current queue backoff time in milliseconds.
Set the backoff time of the queue
Kind: instance property of DotaBot
Param | Type | Description |
---|---|---|
backoff | number |
Exponential backoff time in milliseconds. |
Schedule a function for execution. This function will be executed as soon as the GC is available.
Kind: instance method of DotaBot
Block the queue
Kind: instance method of DotaBot
Unblock the queue
Kind: instance method of DotaBot
Clear the queue
Kind: instance method of DotaBot
Steam client logged off handler. Attempts to log on to steam and connect to Dota
Kind: instance method of DotaBot
Steam client error handler. Attempts to connect to steam and connect to Dota
Kind: instance method of DotaBot
Dota ready handler. Unblocks the queue.
Kind: instance method of DotaBot
Dota unready handler. Blocks the queue.
Kind: instance method of DotaBot
Initiates the connection to Steam and the Dota2 Game Coordinator.
Kind: instance method of DotaBot
Log on to steam. Set online state and display name.
Kind: instance method of DotaBot
Connect to dota and unblock queue.
Kind: instance method of DotaBot
Disconnect from the Game Coordinator. This will also cancel all queued operations!
Kind: instance method of DotaBot
Invites the given steam id to the Dota lobby.
Kind: instance method of DotaBot
Param | Type | Description |
---|---|---|
steamId64 | string |
A steam id. |
Kick the given account id from the lobby team slots.
Kind: instance method of DotaBot
Param | Type | Description |
---|---|---|
accountId | number |
An account id. |
Kick the given account id from the lobby.
Kind: instance method of DotaBot
Param | Type | Description |
---|---|---|
accountId | number |
An account id. |
Join the lobby by dota lobby id.
Kind: instance method of DotaBot
Param | Type | Description |
---|---|---|
dotaLobbyId | string |
A dota lobby id. |
Converts a Dota team slot value to a faction value.
Kind: inner method of dotaBot
Returns: number
- An inhouse lobby faction.
Param | Type | Description |
---|---|---|
slot | number |
The Dota team slot. |
Updates a player to team mapping object. Used to track which players have joined team slots in lobby. A null slot value will remove the player from the mapping meaning they are not in a team slot.
Kind: inner method of dotaBot
Returns: Object
- A player to team mapping.
Param | Type | Description |
---|---|---|
steamId64 | string |
The player's steamid64. |
slot | number |
The lobby team slot the player joined. |
playerState | Object |
A player to team mapping. |
Checks if all entries in a player to team mapping match the player to team state mapping.
Kind: inner method of dotaBot
Returns: boolean
- Whether the player state matches the team cache.
Param | Type | Description |
---|---|---|
teamCache | Object |
The intended player to team state. |
playerState | Object |
The current state of players to teams. |
Start a dota lobby and return the match id.
Kind: inner method of dotaBot
Returns: string
- The match id.
Param | Type | Description |
---|---|---|
dotaBot | module:dotaBot.DotaBot |
The dota bot. |
A Long class for representing a 64 bit two's-complement integer value derived from the Closure Library for stand-alone use and extended with unsigned support.
Kind: inner external of dotaBot
Category: Other
See: long npm package
External namespace for Dota2 classes.
Kind: inner external of dotaBot
Category: node-dota2
See: https://github.com/Arcana/node-dota2
Kind: static class of Dota2
Category: node-dota2
See: https://github.com/Arcana/node-dota2#module_Dota2.Dota2Client
External Dota2 Dota2Client class.
The Steam for Node JS package, allowing interaction with Steam.
Kind: inner external of dotaBot
Category: node-steam
See: steam npm package
Kind: static class of steam
Category: node-steam
See: https://github.com/seishun/node-steam#steamclient
External steam SteamClient class.
Kind: static class of steam
Category: node-steam
See: https://github.com/seishun/node-steam/tree/master/lib/handlers/user
External steam SteamUser class.
Kind: static class of steam
Category: node-steam
See: https://github.com/seishun/node-steam/tree/master/lib/handlers/friends
External steam SteamFriends class.
Kind: inner method of guild
Throws:
InvalidArgumentException
Argument userResolvable must be a Discord.js GuildMember, discord id string, an object with a discordId string property, or an object with a steamId64 property.DiscordUserNotFound
Will throw if a guild member is not found with the discord id.
Kind: inner method of guild
Throws:
InvalidArgumentException
Argument userResolvable must be a role name string or a Discord.js Role object.DiscordUserNotFound
Will throw if a role with the given name is not found.
External namespace for discord.js classes.
Kind: inner external of guild
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/general/welcome
Kind: static class of discordjs
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/class/Client
External Discord.js Client class.
Kind: static class of discordjs
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/class/Guild
External Discord.js Guild class.
Kind: static class of discordjs
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/class/CategoryChannel
External Discord.js CategoryChannel class.
Kind: static class of discordjs
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/class/GuildChannel
External Discord.js GuildChannel class.
Kind: static class of discordjs
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/class/Role
External Discord.js Role class.
Kind: static class of discordjs
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/class/GuildMember
External Discord.js GuildMember class.
Kind: static class of discordjs
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/class/User
External Discord.js User class.
Kind: static class of discordjs
Category: discord.js
See: https://discord.js.org/#/docs/main/stable/class/Message
External Discord.js Message class.
- ihl
- static
- .InhouseState :
Object
- .LeagueGuildObject :
Object
- .InhouseState :
- inner
- ~getUserRankTier(steamId64) ⇒
number
- ~registerUser(guildId, steamId64, discordId) ⇒
User
- ~createInhouseState() ⇒
InhouseState
- ~hasActiveLobbies(user) ⇒
boolean
- ~joinLobbyQueue(lobbyState, user)
- ~getAllLobbyQueues(inhouseState, user)
- ~leaveLobbyQueue(lobbyState, user)
- ~getAllLobbyQueuesForUser(inhouseState, user)
- ~banInhouseQueue(user, timeout)
- ~getUserRankTier(steamId64) ⇒
- static
Kind: static typedef of ihl
Kind: static typedef of ihl
Gets a player's badge rank from opendota.
Kind: inner method of ihl
Returns: number
- The player badge rank.
Param | Type | Description |
---|---|---|
steamId64 | string |
The player's steamid64. |
Adds a player to the inhouse league.
Kind: inner method of ihl
Returns: User
- The newly created user database record.
Param | Type | Description |
---|---|---|
guildId | string |
A guild id. |
steamId64 | string |
The player's steamid64. |
discordId | string |
The player's discord id. |
ihl~createInhouseState() ⇒ InhouseState
Creates an inhouse state. Sets up the inhouse category, channel, and role.
Kind: inner method of ihl
Returns: InhouseState
- An inhouse state object.
Checks if a user has active lobbies.
Kind: inner method of ihl
Returns: boolean
- Whether the user has active lobbies.
Param | Type | Description |
---|---|---|
user | module:db.User |
The user to check. |
Adds a user to a lobby queue.
Kind: inner method of ihl
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
A lobby state. |
user | module:db.User |
The player to queue. |
Add a user to all lobby queues.
Kind: inner method of ihl
Param | Type | Description |
---|---|---|
inhouseState | InhouseState |
An inhouse state. |
user | module:db.User |
The player to queue. |
Removes a user from a lobby queue.
Kind: inner method of ihl
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
A lobby state. |
user | module:db.User |
The player to dequeue. |
Removes a user from all lobby queues.
Kind: inner method of ihl
Param | Type | Description |
---|---|---|
inhouseState | InhouseState |
An inhouse state. |
user | module:db.User |
The player to dequeue. |
Bans a user from an inhouse queue.
Kind: inner method of ihl
Param | Type | Description |
---|---|---|
user | module:db.User |
The player to ban. |
timeout | number |
The duration of ban in minutes. |
- ihlCommand
- static
- Commands
- .BotListCommand ⇐
IHLCommand
- .LeagueInfoCommand ⇐
IHLCommand
- .LeagueSeasonCommand ⇐
IHLCommand
- .LeagueTicketCommand ⇐
IHLCommand
- .LeagueUpdateCommand ⇐
IHLCommand
- .LobbyDraftCommand ⇐
IHLCommand
- .LobbyFirstPickCommand ⇐
IHLCommand
- .LobbyGameModeCommand ⇐
IHLCommand
- .LobbyInviteCommand ⇐
IHLCommand
- .LobbyKickCommand ⇐
IHLCommand
- .LobbyKillCommand ⇐
IHLCommand
- .LobbyLeaveCommand ⇐
IHLCommand
- .LobbyRunCommand ⇐
IHLCommand
- .LobbyStartCommand ⇐
IHLCommand
- .LobbyStateCommand ⇐
IHLCommand
- .LobbySwapCommand ⇐
IHLCommand
- .QueueBanCommand ⇐
IHLCommand
- .QueueClearCommand ⇐
IHLCommand
- .UserBadgeCommand ⇐
IHLCommand
- .UserVouchCommand ⇐
IHLCommand
- .UserVouchCommand ⇐
IHLCommand
- .ChallengeListCommand ⇐
IHLCommand
- .ChallengeCommand ⇐
IHLCommand
- .UnchallengeCommand ⇐
IHLCommand
- .CommendCommand ⇐
IHLCommand
- .DireCommand ⇐
IHLCommand
- .FirstCommand ⇐
IHLCommand
- .GameModeCommand ⇐
IHLCommand
- .InviteCommand ⇐
IHLCommand
- .LeaderboardCommand ⇐
IHLCommand
- .NicknameCommand ⇐
IHLCommand
- .PickCommand ⇐
IHLCommand
- .RadiantCommand ⇐
IHLCommand
- .RegisterCommand ⇐
IHLCommand
- .RepCommand ⇐
IHLCommand
- .RolesCommand ⇐
IHLCommand
- .SecondCommand ⇐
IHLCommand
- .UncommendCommand ⇐
IHLCommand
- .UnrepCommand ⇐
IHLCommand
- .WhoisCommand ⇐
IHLCommand
- .BotAddCommand ⇐
IHLCommand
- .BotLeaveCommand ⇐
IHLCommand
- .BotRemoveCommand ⇐
IHLCommand
- .BotStatusCommand ⇐
IHLCommand
- .DumpMembersCommand ⇐
IHLCommand
- .InviteUrlCommand ⇐
IHLCommand
- .LeagueCreateCommand ⇐
IHLCommand
- .LogLevelCommand ⇐
IHLCommand
- .RestartCommand ⇐
IHLCommand
- .TicketAddCommand ⇐
IHLCommand
- .TicketRemoveCommand ⇐
IHLCommand
- .QueueJoinCommand ⇐
IHLCommand
- .QueueLeaveCommand ⇐
IHLCommand
- .QueueReadyCommand ⇐
IHLCommand
- .QueueStatusCommand ⇐
IHLCommand
- .BotListCommand ⇐
- Commands
- inner
- ~IHLCommand ⇐
external:commando.Command
- Other
- ~IHLCommand ⇐
- static
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: static class of ihlCommand
Extends: IHLCommand
Category: Commands
Kind: inner class of ihlCommand
Extends: external:commando.Command
External namespace for discord.js Commando classes.
Kind: inner external of ihlCommand
Category: Other
See: https://github.com/discordjs/Commando/tree/djs-v11
- ihlManager
- static
- inner
- ~IHLManager
- new IHLManager()
- .init(client)
- .onClientReady()
- .onDiscordMessage(msg)
- .onDiscordMemberLeave(member)
- .createNewLeague(guild)
- .createChallengeLobby(inhouseState, captain1, captain2, challenge)
- .runLobbiesForInhouse(inhouseState)
- .joinLobbyQueue(lobbyState, user, discordUser)
- .joinAllLobbyQueues(inhouseState, user, discordUser)
- .leaveLobbyQueue(lobbyState, user, discordUser)
- .leaveAllLobbyQueues(inhouseState, user, discordUser)
- .clearLobbyQueue(lobbyState)
- .clearAllLobbyQueues(inhouseState)
- .banInhouseQueue(inhouseState, user, timeout, discordUser)
- .registerLobbyTimeout(lobbyState)
- .unregisterLobbyTimeout(lobbyState)
- .runLobby(_lobbyState, states)
- .onCreateLobbyQueue(_lobbyState)
- .onSetLobbyState(_lobbyState, state)
- .onSetBotStatus(steamId64, status)
- .onLeagueTicketAdd(league, leagueid, name)
- .onLeagueTicketSet(league, leagueid) ⇒
module:db.Ticket
- .onLeagueTicketRemove(league, leagueid)
- .onBotAvailable()
- .onBotLobbyLeft()
- .onLobbyTimedOut(lobbyState)
- .onPlayerReady(lobbyState, user)
- .onSelectionPick(_lobbyState, captain, pick)
- .onSelectionSide(_lobbyState, captain, side)
- .onDraftMember(lobbyState, user, faction)
- .onForceLobbyDraft(lobbyState, captain1, captain2)
- .onStartDotaLobby(_lobbyState, _dotaBot) ⇒
module:lobby.lobbyState
- .onLobbySwapTeams(lobbyState)
- .onLobbyKick(lobbyState, user)
- .onLobbyInvite(lobbyState, user)
- .onLobbyReady(dotaLobbyId)
- .onLobbyKill(lobbyState)
- .onMatchSignedOut(matchId)
- .onMatchOutcome(dotaLobbyId, matchOutcome, members)
- .onMatchStats(lobby)
- .onMatchNoStats(lobby)
- .processEventQueue()
- .queueEvent(fn, ...args)
- .getBot(botId) ⇒
module:dotaBot.DotaBot
- .getBotBySteamId(steamId64) ⇒
module:dotaBot.DotaBot
- .loadBotById(botId) ⇒
module:dotaBot.DotaBot
- .loadBotBySteamId(steamId64) ⇒
module:dotaBot.DotaBot
- .loadBot(bot) ⇒
module:dotaBot.DotaBot
- .removeBot(botId)
- .botLeaveLobby(lobbyState) ⇒
null
|string
- .attachListeners()
- ~findUser(guild, member) ⇒
Array
- ~loadInhouseStates(guilds, leagues) ⇒
Array.<InhouseState>
- ~loadInhouseStatesFromLeagues(guilds) ⇒
Array.<InhouseState>
- "ready"
- "empty"
- "EVENT_MATCH_STATS" (lobby)
- ~eventCallback :
function
- Other
- ~IHLManager
This provides methods used for ihlManager event handling.
Kind: static mixin of ihlManager
This provides methods used for ihlManager lobby queue state handling.
Kind: static mixin of ihlManager
This provides methods used for ihlManager lobby state handling.
Kind: static mixin of ihlManager
Class representing the inhouse league manager.
Kind: inner class of ihlManager
- ~IHLManager
- new IHLManager()
- .init(client)
- .onClientReady()
- .onDiscordMessage(msg)
- .onDiscordMemberLeave(member)
- .createNewLeague(guild)
- .createChallengeLobby(inhouseState, captain1, captain2, challenge)
- .runLobbiesForInhouse(inhouseState)
- .joinLobbyQueue(lobbyState, user, discordUser)
- .joinAllLobbyQueues(inhouseState, user, discordUser)
- .leaveLobbyQueue(lobbyState, user, discordUser)
- .leaveAllLobbyQueues(inhouseState, user, discordUser)
- .clearLobbyQueue(lobbyState)
- .clearAllLobbyQueues(inhouseState)
- .banInhouseQueue(inhouseState, user, timeout, discordUser)
- .registerLobbyTimeout(lobbyState)
- .unregisterLobbyTimeout(lobbyState)
- .runLobby(_lobbyState, states)
- .onCreateLobbyQueue(_lobbyState)
- .onSetLobbyState(_lobbyState, state)
- .onSetBotStatus(steamId64, status)
- .onLeagueTicketAdd(league, leagueid, name)
- .onLeagueTicketSet(league, leagueid) ⇒
module:db.Ticket
- .onLeagueTicketRemove(league, leagueid)
- .onBotAvailable()
- .onBotLobbyLeft()
- .onLobbyTimedOut(lobbyState)
- .onPlayerReady(lobbyState, user)
- .onSelectionPick(_lobbyState, captain, pick)
- .onSelectionSide(_lobbyState, captain, side)
- .onDraftMember(lobbyState, user, faction)
- .onForceLobbyDraft(lobbyState, captain1, captain2)
- .onStartDotaLobby(_lobbyState, _dotaBot) ⇒
module:lobby.lobbyState
- .onLobbySwapTeams(lobbyState)
- .onLobbyKick(lobbyState, user)
- .onLobbyInvite(lobbyState, user)
- .onLobbyReady(dotaLobbyId)
- .onLobbyKill(lobbyState)
- .onMatchSignedOut(matchId)
- .onMatchOutcome(dotaLobbyId, matchOutcome, members)
- .onMatchStats(lobby)
- .onMatchNoStats(lobby)
- .processEventQueue()
- .queueEvent(fn, ...args)
- .getBot(botId) ⇒
module:dotaBot.DotaBot
- .getBotBySteamId(steamId64) ⇒
module:dotaBot.DotaBot
- .loadBotById(botId) ⇒
module:dotaBot.DotaBot
- .loadBotBySteamId(steamId64) ⇒
module:dotaBot.DotaBot
- .loadBot(bot) ⇒
module:dotaBot.DotaBot
- .removeBot(botId)
- .botLeaveLobby(lobbyState) ⇒
null
|string
- .attachListeners()
Creates an inhouse league manager.
Initializes the inhouse league manager with a discord client and loads inhouse states for each league.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
client | external:Client |
A discord.js client. |
Discord client ready handler.
Kind: instance method of IHLManager
Emits: ready
Discord message handler.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
msg | Message |
The discord message. |
Discord user left guild handler.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
member | GuildMember |
The member that left. |
Creates a new inhouse in a discord guild.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
guild | Guild |
The discord guild for the inhouse. |
Creates and runs a challenge lobby.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
inhouseState | module:ihl.inhouseState |
The inhouse state. |
captain1 | module:db.User |
The first lobby captain. |
captain2 | module:db.User |
The second lobby captain. |
challenge | module:db.Challenge |
The challenge between the two captains. |
Runs all lobbies for an inhouse.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
inhouseState | module:ihl.inhouseState |
The inhouse state. |
Adds a user to a lobby queue.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
The lobby to join. |
user | module:db.User |
The user to queue. |
discordUser | User |
A discord.js user. |
Adds a user to all lobby queues.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
inhouseState | InhouseState |
The inhouse to queue. |
user | module:db.User |
The user to queue. |
discordUser | User |
A discord.js user. |
Removes a user from a lobby queue.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
The lobby to join. |
user | module:db.User |
The user to dequeue. |
discordUser | User |
A discord.js user. |
Removes a user from all lobby queues.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
inhouseState | InhouseState |
The inhouse to dequeue. |
user | module:db.User |
The user to dequeue. |
discordUser | User |
A discord.js user. |
Clear a lobby queue.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
The lobby queue to clear. |
Clear all lobby queues.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
inhouseState | InhouseState |
The inhouse queue to clear. |
Bans a user from the inhouse queue.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
inhouseState | InhouseState |
The inhouse to dequeue. |
user | module:db.User |
The player to ban. |
timeout | number |
Duration of ban in minutes. |
discordUser | User |
A discord.js user. |
Creates and registers a ready up timer for a lobby state.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
Clears and unregisters the ready up timer for a lobby state.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
Processes and executes a lobby state if it matches any of the given states. If no states to match against are given, the lobby state is run by default.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
_lobbyState | LobbyState |
An inhouse lobby state. |
states | Array.<string> |
A list of valid lobby states. |
Creates a queue lobby.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
_lobbyState | LobbyState |
The lobby state to create the queue from. |
Sets a lobby state.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
_lobbyState | LobbyState |
The lobby state being changed. |
state | string |
The state to set the lobby to. |
Sets a bot status.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
steamId64 | string |
Bot steam id. |
status | string |
Bot status. |
Associates a league with a ticket.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
league | module:db.League |
The league to add the ticket to. |
leagueid | number |
The ticket league id. |
name | string |
The ticket name. |
Sets the league ticket.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
league | module:db.League |
The league to set the ticket to. |
leagueid | number |
The ticket league id. |
Removes a ticket from a league.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
league | module:db.League |
The league to remove the ticket from. |
leagueid | number |
The ticket league id. |
Runs lobbies waiting for bots.
Kind: instance method of IHLManager
Set bot idle then call onBotAvailable to run lobbies waiting for bots.
Kind: instance method of IHLManager
Runs a lobby state when its ready up timer has expired. Checks for STATE_CHECKING_READY lobby state
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
Runs a lobby state when a player has readied up and update their player ready state. Checks for STATE_CHECKING_READY lobby state
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
user | module:db.User |
An inhouse user. |
Updates a lobby state with a captain pick selection
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
_lobbyState | LobbyState |
An inhouse lobby state. |
captain | module:db.User |
The captain user |
pick | number |
The selected pick |
Updates a lobby state with a captain side selection
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
_lobbyState | LobbyState |
An inhouse lobby state. |
captain | module:db.User |
The captain user |
side | number |
The selected faction |
Checks if a player is draftable and fires an event representing the result. If the player is draftable, checks for STATE_DRAFTING_PLAYERS lobby state and runs the lobby state.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
user | module:db.User |
The picked user |
faction | number |
The picking faction |
Force lobby into player draft with assigned captains.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
captain1 | module:db.User |
The captain 1 user |
captain2 | module:db.User |
The captain 2 user |
Start a dota lobby if all players are in the lobby and on the correct teams.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
_lobbyState | module:lobby.lobbyState |
The lobby state to check. |
_dotaBot | module:lobby.lobbyState |
The bot to check. |
Swap teams in the dota lobby.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
Kicks a player from the dota lobby.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
user | module:db.User |
The player to kick |
Invites a player to the dota lobby.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
user | module:db.User |
The player to invite |
Runs a lobby state when the lobby is ready (all players have joined and are in the right team slot). Checks for STATE_WAITING_FOR_PLAYERS lobby state
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
dotaLobbyId | string |
A dota lobby id. |
Puts a lobby state in STATE_PENDING_KILL and runs lobby.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobbyState | LobbyState |
An inhouse lobby state. |
Handles match signed out bot event. Updates STATE_MATCH_IN_PROGRESS lobby state to STATE_MATCH_ENDED
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
matchId | number |
A dota match id. |
Handles match outcome bot event. Updates lobby winner and player stats. Sends match stats message. Puts lobby into STATE_MATCH_STATS state
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
dotaLobbyId | string |
A dota lobby id. |
matchOutcome | external:Dota2.schema.EMatchOutcome |
The dota match outcome |
members | Array.<external:Dota2.schema.CDOTALobbyMember> |
Array of dota lobby members |
Handles match tracker match stats event. Sends match stats message. Puts lobby into STATE_MATCH_STATS state
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobby | module:db.Lobby |
A lobby database model |
Handles match tracker match no stats event. Sends match no stats message. Puts lobby into STATE_MATCH_NO_STATS state
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
lobby | module:db.Lobby |
A lobby database model |
Processes the inhouse manager event queue until it is empty. Events are actions to perform (mostly on lobby states or something that resolves to a lobby state). An event consists of a function, the arguments to call it with, and the resolve and reject callbacks of the Promise wrapping the action. When the action is executed, resolve with the returned value or reject if an error was thrown. The queue blocks while processing an action, so only 1 can be processed at a time.
Kind: instance method of IHLManager
Emits: empty
Adds a lobby processing function and its arguments to the queue. When the queue is processed the function will be executed with its arguments.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
fn | eventCallback |
A lobby processing event function. |
...args | * |
A list of arguments the lobby processing event function will be called with. |
Gets a bot.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
botId | number |
The bot id. |
Gets a bot by steam id.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
steamId64 | number |
The bot steam id. |
Start a dota bot by id.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
botId | number |
The bot id. |
Start a dota bot by steam id.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
steamId64 | number |
The bot steam id. |
Start a dota bot.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
bot | module:db.Bot |
The bot model. |
Remove a dota bot.
Kind: instance method of IHLManager
Param | Type | Description |
---|---|---|
botId | number |
The bot id. |
Disconnect a dota bot from its lobby. The bot should eventually emit EVENT_BOT_LOBBY_LEFT.
Kind: instance method of IHLManager
Returns: null
| string
- Null if the bot left the lobby or a string containing the error reason.
Param | Type | Description |
---|---|---|
lobbyState | module:lobby.lobbyState |
The lobby for the bot. |
Bind all events to their corresponding event handler functions
Kind: instance method of IHLManager
Searches the discord guild for a member.
Kind: inner method of ihlManager
Returns: Array
- The search result in an array containing the user record, discord guild member, and type of match.
Param | Type | Description |
---|---|---|
guild | external:Guild |
A list of guilds to initialize leagues with. |
member | string | external:GuildMember |
A name or search string for an inhouse player or their guild member instance. |
ihlManager~loadInhouseStates(guilds, leagues) ⇒ Array.<InhouseState>
Maps league records to inhouse states.
Kind: inner method of ihlManager
Returns: Array.<InhouseState>
- The inhouse states loaded from league records.
Param | Type | Description |
---|---|---|
guilds | Array.<external:Guild> |
A list of guilds to initialize leagues with. |
leagues | Array.<module:db.League> |
A list of database league records. |
ihlManager~loadInhouseStatesFromLeagues(guilds) ⇒ Array.<InhouseState>
Gets all league records from the database turns them into inhouse states.
Kind: inner method of ihlManager
Returns: Array.<InhouseState>
- The inhouse states loaded from all league records.
Param | Type | Description |
---|---|---|
guilds | Array.<external:Guild> |
A list of guilds to initialize leagues with. |
IHLManager ready event.
Kind: event emitted by ihlManager
IHLManager event queue empty event.
Kind: event emitted by ihlManager
Event for returning stats from a lobby.
Kind: event emitted by ihlManager
Param | Type | Description |
---|---|---|
lobby | module:db.Lobby |
The lobby with stats. |
Callback for a lobby processing event.
Kind: inner typedef of ihlManager
Node.js EventEmitter object
Kind: inner external of ihlManager
Category: Other
See: https://nodejs.org/api/events.html#events_class_eventemitter
Kind: static typedef of lobby
Match tracker checks opendota and valve match apis to see if a match has finished and saves the match data to the database.
Kind: inner class of matchTracker
Creates an inhouse league match tracker.
The match polling loop
Kind: instance method of MatchTracker
Emits: EVENT_MATCH_STATS
Enables the match polling loop
Kind: instance method of MatchTracker
Disables the match polling loop
Kind: instance method of MatchTracker