ValvePython / dota2

🐸 Python package for interacting with Dota 2 Game Coordinator
http://dota2.readthedocs.io
201 stars 32 forks source link

on channel_joined - no members, can't send messages #31

Closed LadaBr closed 7 years ago

LadaBr commented 7 years ago

When I call

    @dota.on('ready')
    def do_dota_stuff():
        dota.channels.join_channel(str("Brno, Czech Republic"),channel_type=0)

    @dota.channels.on('channel_joined')
    def get_chats(channel):
        pprint(channel.__dict__)
        channel.send(str("test"))

it shows message below but nothing appears in-game (tried custom chat channel also) and there is 0 members when I print info about it to console.

'_manager': <ChannelManager(): 1 channels>, 'id': 326, 'max_members': 2000, 'members': {}, 'name': 'Brno, Czech Republic', 'type': 0, 'user_id': 3367592089}

[2017-04-18 09:58:55,398] DEBUG Dota2Client: Outgoing: <EDOTAGCMsg.EMsgGCChatMessage: 7273>

It also gets messages from GC correctly:

[2017-04-18 11:14:41,861] DEBUG Dota2Client.channels: Emit event: 'message'

Philaeux commented 7 years ago

Are you sure your account is not limited ? Limited account (if you didn't add at least 5$ on the account) are not able to talk in public channels. Their messages are filtered.

It is the same with friends invites. Limited accounts are not able to invite people as friends.

LadaBr commented 7 years ago

I didn't know that. Thanks for info.

Philaeux commented 7 years ago

What you can do, is test in the lobby chat if your code is ok (bot create lobby, invite your real account, print in chat). If everything works, you can pay 5$ for futur public usage.