Models¶
Note
Nearly all classes here have slots defined which means that it is impossible to have dynamic attributes to the data classes.
Messages¶
Message¶
- class slack.Message¶
This function is a constructor for the Message class. It takes in two parameters, state and data. The state parameter is a ConnectionState object, and the data parameter is a MessagePayload object. The function then sets the state, team_id, id, author, channel_id, and created_at attributes of the Message object
- created_at¶
Message created at.
- Type
datetime
- property author: Optional[Member]¶
Message author.
- Returns
Message author.
- Return type
Optional[
Member]
- await delete() DeletedMessage¶
It deletes a message.
Changed in version 1.4.0: Return
DeletedMessage- Returns
A DeletedMessage object.
- Return type
DeletedMessage¶
JoinMessage¶
- class slack.JoinMessage¶
This function is a constructor for the JoinMessage class. It takes in a ConnectionState and a JoinMessagePayload as parameters and sets the author of the message to the user in the JoinMessagePayload
- property author: Optional[Member]¶
Message author.
- Returns
Message author.
- Return type
Optional[
Member]
- await delete() DeletedMessage¶
It deletes a message.
Changed in version 1.4.0: Return
DeletedMessage- Returns
A DeletedMessage object.
- Return type
Channels¶
Channel¶
- asyncarchive
- asyncsend
- asyncsend_as_user
- asyncsend_ephemeral
- class slack.Channel¶
This function is a constructor for the Channel class. It takes in a ConnectionState object and a ChannelPayload object. It sets the state, id, name, team, created_at, and created_by attributes of the Channel object. It then calls the overload function
- created_at¶
When create this channel.
- Type
datetime
- await send(text: str)¶
- await send(view: ViewFrame)
This function is a coroutine
It sends a message to a channel.
Changed in version 1.4.0: Add view parameter.
DeletedChannel¶
Teams¶
- asynccreate_channel
- class slack.Team¶
This function takes in a TeamPayload object and sets the data attribute of the Team object to the TeamPayload object
Icon¶
Members¶
- class slack.Member¶
This function takes in a UserPayload object and assigns it to the data attribute of the User class