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 class 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
- asyncsend_file
- asyncsend_schedule
- 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.
- Parameters:
- Raises:
InvalidArgumentException – Raise when text and view are in param.
- Returns:
A Message object.
- Return type:
- await send_as_user(text: str)¶
This function is a coroutine Message is sended by you. not application.
Deprecated since version 1.4.2: Use :send: func.
- await send_ephemeral(text: str, member: Member) datetime¶
This function is a coroutine Send Ephemeral message.
New in version 1.4.0.
- await send_file(attachment: Attachment) File¶
This function occur sending file.
- Parameters:
attachment (
Attachment) – Your file to send.- Returns:
Sended data of file.
- Return type:
File
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