10.1.7. Class cerebro.aclasses.Message¶
-
class
cerebro.aclasses.
Message
(message_id)[source]¶ Bases:
cerebro.aclasses.AbstractMessage
Message class.
Methods
add_hashtags()
attachments()
creator_id()
data()
id()
moderator_id()
modification_time()
remove_hashtags()
methods of the basic class cerebro.aclasses.AbstractMessage
message = cerebro.core.current_message()
message = cerebro.core.message(message_id)
Parameters: hashtags (string, set(string, ) or list(string, )) – hashtag or array of hashtags (every hashtag should be written in one word without spaces). Adds hashtags to the message.
See also
-
attachments
()[source]¶ Returns: a list of attachments to the message. Return type: list( cerebro.aclasses.Attachment
,)
-
data
()[source]¶ Returns: data tuple
on the message.Return type: tuple Actually, the most part of the methods of this class are interfaces to this tuple. Therefore, you can use its data directly from the tuple.
message.creator_id() == message.data()[message.DATA_CREATOR_ID] message.is_client_visible() == cerebro.core.has_flag(message.data()[message.DATA_FLAGS], message.FLAG_CLIENT_VISIBLE) # etc.