10.6.18. Class cerebro.events.BeforeEventCreationOfMessage

class cerebro.events.BeforeEventCreationOfMessage(event_type, event_id)[source]

Bases: cerebro.events.BeforeEventMessage

The class for the task creation event. Grants access to the data of a newly created message before it is written into the database.

Methods

The class object is input into the before_event and error_event (in case of error) functions of the event module.

def before_event(event):        
        if event.event_type() == event.EVENT_CREATION_OF_MESSAGE:
                ...
add_hashtags(hashtags)[source]
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

remove_hashtags().

remove_hashtags(hashtags)[source]
Parameters:hashtags (string, set(string, ) or list(string, )) – hashtag or array of hashtags (every hashtag should be written in one word without spaces).

Remove hashtags from the message.

See also

add_hashtags().