MCPcopy Create free account
hub / github.com/ehForwarderBot/ehForwarderBot / __init__

Method __init__

ehforwarderbot/chat.py:220–249  ·  view source on GitHub ↗

Args: chat (:class:`~.chat.Chat`): Chat associated with this member. Keyword Args: name (str): Name of the member. alias (Optional[str]): Alternative name of the member, usually set by user. uid (:obj:`.ChatID` (str)):

(self, chat: 'Chat', *,
                 name: str = "", alias: Optional[str] = None, uid: ChatID = ChatID(""),
                 id: ChatID = ChatID(""),
                 vendor_specific: Dict[str, Any] = None, description: str = "",
                 middleware: Optional[Middleware] = None)

Source from the content-addressed store, hash-verified

218 to keep any object of its subclass also picklable.
219 """
220 def __init__(self, chat: 'Chat', *,
221 name: str = "", alias: Optional[str] = None, uid: ChatID = ChatID(""),
222 id: ChatID = ChatID(""),
223 vendor_specific: Dict[str, Any] = None, description: str = "",
224 middleware: Optional[Middleware] = None):
225 """
226 Args:
227 chat (:class:`~.chat.Chat`): Chat associated with this member.
228
229 Keyword Args:
230 name (str): Name of the member.
231 alias (Optional[str]): Alternative name of the member, usually set by user.
232 uid (:obj:`.ChatID` (str)):
233 Unique ID of the member. This MUST be unique within the channel.
234 This ID can be the same with a private chat of the same person.
235 description (str):
236 A text description of the member, usually known as “bio”,
237 “description”, “summary” or “introduction” of the member.
238 middleware (:class:`.Middleware`): Initialize this chat as a part
239 of a middleware.
240 """
241 if middleware:
242 super().__init__(module_name=middleware.middleware_name, channel_emoji="",
243 module_id=middleware.middleware_id, name=name, alias=alias, id=id, uid=uid,
244 vendor_specific=vendor_specific, description=description)
245 else:
246 super().__init__(module_name=chat.module_name, channel_emoji=chat.channel_emoji,
247 module_id=chat.module_id, name=name, alias=alias, id=id, uid=uid,
248 vendor_specific=vendor_specific, description=description)
249 self.chat: 'Chat' = chat
250
251 def verify(self):
252 super().verify()

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected