neokuze / chatango-lib

Async Library for chatango written in Python3.8
https://asynclibraryinpython.chatango.com
GNU General Public License v3.0
9 stars 3 forks source link

Getting Channel on_meesage #2

Closed methecooldude closed 1 year ago

methecooldude commented 1 year ago

Is there any way of finding out which channel the message was received on when on_message is called? For instance, if its in the mod channel, I can then handle the message differently to the public channel

TheClonerx commented 1 year ago

The message's .flags property contains which channel the message was sent on.

methecooldude commented 1 year ago

Ok, that gets me what I want, however (and excuse the Python stupid here): If I print that out I get the result MessageFlags.CHANNEL_MOD|SHOW_MOD_ICON|BG_ON So how would one check if CHANNEL_MOD in in the flags

neokuze commented 1 year ago

Ok, that gets me what I want, however (and excuse the Python stupid here): If I print that out I get the result MessageFlags.CHANNEL_MOD|SHOW_MOD_ICON|BG_ON So how would one check if CHANNEL_MOD in in the flags

Well channel_mod flag is in chatango.message.MessageFlags

Also let me fix... Something to do it more easy...

To know is exist in the flags, do the same. "def on_message" if chatango.message.MessageFlags.CHANNEL_MOD in message.flags: whatever

!e await message.room.send_message("test", flags=chatango.message.MessageFlags.CHANNEL_MOD.value)

Reinstall the lib.