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

Yolotroll101 picture Yolotroll101  路  3Comments

ghost picture ghost  路  3Comments

JackL0 picture JackL0  路  3Comments

Be4Vision picture Be4Vision  路  3Comments

TheGrammarJew picture TheGrammarJew  路  3Comments