Discord.py: message.channel returns object

Created on 22 May 2016  路  3Comments  路  Source: Rapptz/discord.py

Might be stupid but ... I'm trying to get the channel name and get

@client.event
def on_message(message):
    print(str(message.channel))

This way I can not distinguish between channels, any help?
python3.5

Most helpful comment

To distinguish between channels use its unique ID. message.channel.id. As per the documentation, message.channel can be an Object if unordered messages happen.

All 3 comments

try message.channel.name

To distinguish between channels use its unique ID. message.channel.id. As per the documentation, message.channel can be an Object if unordered messages happen.

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danshat picture danshat  路  3Comments

tairabiteru picture tairabiteru  路  3Comments

AraHaan picture AraHaan  路  3Comments

TheGrammarJew picture TheGrammarJew  路  3Comments

PicklesJars picture PicklesJars  路  3Comments