EFBChat

class ehforwarderbot.EFBChat(channel: Optional[ehforwarderbot.channel.EFBChannel] = None, middleware: Optional[ehforwarderbot.middleware.EFBMiddleware] = None)[source]

EFB Chat object. This is used to represent a chat or a group member.

module_id

Unique ID of the module.

Type

str

channel_emoji

Emoji of the channel, if available.

Type

Optional[str]

module_name

Name of the module.

Type

str

chat_name

Name of the chat.

Type

str

chat_alias

Alternative name of the chat, usually set by user.

Type

str

chat_type

Type of the chat.

Type

ChatType

chat_uid

Unique ID of the chat. This should be unique within the channel.

Type

str

is_chat

Indicate if this object represents a chat. Defaulted to True. This should be set to False when used on a group member.

Type

bool

group

The parent chat of the member. Only available to chat member objects. Defaulted to None.

Type

EFBChat or None

members

Provide a list of members in the group. Defaulted to an empty list. You may want to extend this object and implement a @property method set for loading members on demand.

Type

list of EFBChat

vendor_specific

Any vendor specific attributes.

Type

Dict[str, Any]

__init__(channel: Optional[ehforwarderbot.channel.EFBChannel] = None, middleware: Optional[ehforwarderbot.middleware.EFBMiddleware] = None)[source]
Parameters
channel_id

Alias to module_id. (This property will be deprecated)

channel_name

Alias to module_name. (This property will be deprecated)

display_name

Shortcut property, equivalent to chat_alias or chat_name

is_self

If this chat represents the user

is_system

If this chat is a system chat

long_name

Shortcut property, if alias exists, this will provide the alias with name in parenthesis. Otherwise, this will return the name

self() → ehforwarderbot.chat.EFBChat[source]

Set the chat as yourself. In this context, “yourself” means the user behind the master channel. Every channel should relate this to the corresponding target.

Returns

This object.

Return type

EFBChat

system() → ehforwarderbot.chat.EFBChat[source]

Set the chat as a system chat. Only set for channel-level and group-level system chats.

Returns

This object.

Return type

EFBChat

verify()[source]

Verify the completeness of the data.

Raises

ValueError – When this chat is invalid.