Status

class ehforwarderbot.status.Status[sumber]

Abstract class of a status

destination_channel

The channel that this status is sent to, usually the master channel.

Type

Channel

class ehforwarderbot.status.ChatUpdates(channel, new_chats=(), removed_chats=(), modified_chats=())[sumber]

Inform the master channel on updates of slave chats.

channel

Slave channel that issues the update

Type

SlaveChannel

new_chats

Unique ID of new chats

Type

Optional[Collection[str]]

removed_chats

Unique ID of removed chats

Type

Optional[Collection[str]]

modified_chats

Unique ID of modified chats

Type

Optional[Collection[str]]

__init__(channel, new_chats=(), removed_chats=(), modified_chats=())[sumber]
Parameter
  • channel (SlaveChannel) -- Slave channel that issues the update

  • new_chats (Optional[Collection[str]]) -- Unique ID of new chats

  • removed_chats (Optional[Collection[str]]) -- Unique ID of removed chats

  • modified_chats (Optional[Collection[str]]) -- Unique ID of modified chats

class ehforwarderbot.status.MemberUpdates(channel, chat_id, new_members=(), removed_members=(), modified_members=())[sumber]

Inform the master channel on updates of members in a slave chat.

channel

Slave channel that issues the update

Type

SlaveChannel

chat_id

Unique ID of the chat.

Type

str

new_members

Unique ID of new members

Type

Optional[Collection[str]]

removed_members

Unique ID of removed members

Type

Optional[Collection[str]]

modified_members

Unique ID of modified members

Type

Optional[Collection[str]]

__init__(channel, chat_id, new_members=(), removed_members=(), modified_members=())[sumber]
Parameter
  • channel (SlaveChannel) -- Slave channel that issues the update

  • chat_id (str) -- Unique ID of the chat.

  • new_members (Optional[Collection[str]]) -- Unique ID of new members

  • removed_members (Optional[Collection[str]]) -- Unique ID of removed members

  • modified_members (Optional[Collection[str]]) -- Unique ID of modified members

class ehforwarderbot.status.MessageReactionsUpdate(chat, msg_id, reactions)[sumber]

Update reacts of a message, issued from slave channel to master channel.

Parameter
  • chat (Chat) -- The chat where message is sent

  • msg_id (str) -- ID of the message for the reacts

  • reactions (Mapping[NewType()(ReactionName, str), Collection[ChatMember]]) -- Indicate reactions to the message. Dictionary key represents the reaction name, usually an emoji. Value is a collection of users who reacted to the message with that certain emoji. All Chat objects in this dict MUST be members in the chat of the message.

  • destination_channel (MasterChannel) -- Channel the status is issued to, which is always the master channel.

__init__(chat, msg_id, reactions)[sumber]
Parameter
  • chat (Chat) -- The chat where message is sent

  • msg_id (str) -- ID of the message for the reacts

  • reactions (Mapping[NewType()(ReactionName, str), Collection[ChatMember]]) -- Indicate reactions to the message. Dictionary key represents the reaction name, usually an emoji. Value is a collection of users who reacted to the message with that certain emoji. All Chat objects in this dict MUST be members in the chat of the message.

class ehforwarderbot.status.MessageRemoval(source_channel, destination_channel, message)[sumber]

Inform a channel to remove a certain message.

This is usually known as “delete from everyone”, “delete from recipient”, “recall a message”, “unsend”, or “revoke a message” as well, depends on the IM platform.

Some channels MAY not support removal of messages, and raises a exceptions.EFBOperationNotSupported exception.

Feedback by sending another MessageRemoval back is not required when this object is sent from a master channel. Master channels SHOULD treat a successful delivery of this status as a successful removal.

source_channel

Channel issued the status

Type

Channel

destination_channel

Channel the status is issued to

Type

Channel

message

Message to remove. This MAY not be a complete message.Message object.

Type

Message

Raises

.exceptions.EFBOperationNotSupported -- When message removal is not supported in the channel.

__init__(source_channel, destination_channel, message)[sumber]

Create a message removal status

Try to provided as much as you can, if not, provide a minimum information in the channel:

Parameter
  • source_channel (Channel) -- Channel issued the status

  • destination_channel (Channel) -- Channel the status is issued to

  • message (Message) -- Message to remove.

class ehforwarderbot.status.ReactToMessage(chat, msg_id, reaction)[sumber]

Created when user react to a message, issued from master channel.

When this status is sent, a status.MessageReactionsUpdate is RECOMMENDED to be issued back to master channel.

Parameter
  • chat (Chat) -- The chat where message is sent

  • msg_id (str) -- ID of the message to react to

  • reaction (Optional[str]) -- The reaction name to be sent, usually an emoji. Set to None to remove reaction.

  • destination_channel (SlaveChannel) -- Channel the status is issued to, extracted from the chat object.

Raises
  • .exceptions.EFBMessageReactionNotPossible -- Raised when the reaction is not valid (e.g. the specific reaction is not in the list of possible reactions).

  • .exceptions.EFBOperationNotSupported -- Raised when reaction in any form is not supported to the message at all.

__init__(chat, msg_id, reaction)[sumber]
Parameter
  • chat (Chat) -- The chat where message is sent

  • msg_id (str) -- ID of the message to react to

  • reaction (Optional[NewType()(ReactionName, str)]) -- The reaction name to be sent, usually an emoji