chat

Chat channel features

class dota2.features.chat.ChatBase

Bases: object

class dota2.features.chat.ChannelManager(dota_client, logger_name)

Bases: eventemitter.EventEmitter

EVENT_JOINED_CHANNEL = 'channel_joined'

When the client join a channel.

Parameters:channel (ChatChannel) – channel instance
EVENT_LEFT_CHANNEL = 'channel_left'

When the client leaves a channel.

Parameters:channel (ChatChannel) – channel instance
EVENT_MESSAGE = 'message'

On a new channel message

Parameters:
EVENT_CHANNEL_MEMBERS_UPDATE = 'members_update'

When users join/leave a channel

Parameters:
  • channel (ChatChannel) – channel instance
  • joined (list) – list of members who joined
  • left (list) – list of members who left
emit(event, *args)

Emit event with some arguments

Parameters:
  • event (any type) – event identifier
  • args – any or no arguments
join_channel(channel_name, channel_type=<DOTAChatChannelType_t.DOTAChannelType_Custom: 1>)

Join a chat channel

Parameters:
Returns:

join result

Return type:

int

Response event: EVENT_JOINED_CHANNEL

join_lobby_channel()

Join the lobby channel if the client is in a lobby.

Response event: EVENT_JOINED_CHANNEL

lobby

References lobby channel if client has joined it

Returns:channel instance
Return type:ChatChannel
join_party_channel()

Join the lobby channel if the client is in a lobby.

Response event: EVENT_JOINED_CHANNEL

party

References party channel if client has joined it

Returns:channel instance
Return type:ChatChannel
get_channel_list()

Requests a list of chat channels from the GC.

Returns:List of chat channels
Return type:CMsgDOTAChatGetUserListResponse, None
leave_channel(channel_id)
class dota2.features.chat.ChatChannel(channel_manager, join_data)

Bases: object

leave()

Leave channel

send(message)

Send a message to the channel

Parameters:message (str) – message text
share_lobby()

Share current lobby to the channel

flip_coin()

Flip a coin

roll_dice(rollmin=1, rollmax=100)

Roll a dice

Parameters:
  • rollmin (int) – dice min value
  • rollmax (int) – dice max value