enconnect.irc package#
Submodules#
enconnect.irc.client module#
- class enconnect.irc.client.Client(params: ClientParams, logger: Callable[[...], None] | None = None)[source]#
Bases:
objectEstablish and maintain connection with the chat service.
- Parameters:
params – Parameters used to instantiate the class.
- property params: ClientParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property connected: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property nickname: str | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property mqueue: Queue[ClientEvent]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property canceled: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
enconnect.irc.models module#
- class enconnect.irc.models.ClientEvent[source]#
Bases:
BaseModelContains information returned from the upstream server.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
FalseNo
FalseLiteral[‘event’, ‘chanmsg’, ‘privmsg’]No
'event'No
Nonemin_length=1
Yes
min_length=1
No
NoneNo
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
- prefix: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Prefix or origin information', metadata=[MinLen(min_length=1)])]#
- command: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Code or command for the event', metadata=[MinLen(min_length=1)])]#
- params: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Event or command parameters')]#
- original: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Original received from server', metadata=[MinLen(min_length=1)])]#
- kind: Annotated[Literal['event', 'chanmsg', 'privmsg'], FieldInfo(annotation=NoneType, required=False, default='event', description='Dynamic field parsed from event')]#
- isme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message is from client')]#
- hasme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message mentions client')]#
- whome: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Current nickname of when received', metadata=[MinLen(min_length=1)])]#
- author: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Dynamic field parsed from event', metadata=[MinLen(min_length=1)])]#
enconnect.irc.params module#
- class enconnect.irc.params.ClientParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
'ircbot'min_length=1
Literal[‘normal’, ‘service’]No
'normal'No
Nonemin_length=1
No
6697ge=1, le=65535
No
10000ge=1000, le=1000000
No
'Chatting Robie'min_length=1
Yes
min_length=1
No
'42X'min_length=1
No
'services.invalid'min_length=1
No
TrueNo
TrueNo
30ge=1, le=300
No
'ircbot'min_length=1
- server: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Server address for connection', metadata=[MinLen(min_length=1)])]#
- port: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=6697, description='Server address for connection', metadata=[Ge(ge=1), Le(le=65535)])]#
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- operate: Annotated[Literal['normal', 'service'], FieldInfo(annotation=NoneType, required=False, default='normal', description='Method for server connection')]#
- nickname: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='ircbot', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- username: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='ircbot', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- realname: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='Chatting Robie', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- servername: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='services.invalid', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- serverid: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='42X', description='Unique identifier for services', metadata=[MinLen(min_length=1)])]#
- ssl_enable: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Enable connection encryption')]#
Module contents#
- class enconnect.irc.Client(params: ClientParams, logger: Callable[[...], None] | None = None)[source]#
Bases:
objectEstablish and maintain connection with the chat service.
- Parameters:
params – Parameters used to instantiate the class.
- property params: ClientParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property connected: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property nickname: str | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property mqueue: Queue[ClientEvent]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property canceled: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- class enconnect.irc.ClientParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
'ircbot'min_length=1
Literal[‘normal’, ‘service’]No
'normal'No
Nonemin_length=1
No
6697ge=1, le=65535
No
10000ge=1000, le=1000000
No
'Chatting Robie'min_length=1
Yes
min_length=1
No
'42X'min_length=1
No
'services.invalid'min_length=1
No
TrueNo
TrueNo
30ge=1, le=300
No
'ircbot'min_length=1
- server: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Server address for connection', metadata=[MinLen(min_length=1)])]#
- port: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=6697, description='Server address for connection', metadata=[Ge(ge=1), Le(le=65535)])]#
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- operate: Annotated[Literal['normal', 'service'], FieldInfo(annotation=NoneType, required=False, default='normal', description='Method for server connection')]#
- nickname: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='ircbot', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- username: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='ircbot', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- realname: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='Chatting Robie', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- servername: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='services.invalid', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- serverid: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='42X', description='Unique identifier for services', metadata=[MinLen(min_length=1)])]#
- ssl_enable: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Enable connection encryption')]#
- class enconnect.irc.ClientEvent[source]#
Bases:
BaseModelContains information returned from the upstream server.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
FalseNo
FalseLiteral[‘event’, ‘chanmsg’, ‘privmsg’]No
'event'No
Nonemin_length=1
Yes
min_length=1
No
NoneNo
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
- prefix: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Prefix or origin information', metadata=[MinLen(min_length=1)])]#
- command: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Code or command for the event', metadata=[MinLen(min_length=1)])]#
- params: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Event or command parameters')]#
- original: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Original received from server', metadata=[MinLen(min_length=1)])]#
- kind: Annotated[Literal['event', 'chanmsg', 'privmsg'], FieldInfo(annotation=NoneType, required=False, default='event', description='Dynamic field parsed from event')]#
- isme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message is from client')]#
- hasme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message mentions client')]#
- whome: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Current nickname of when received', metadata=[MinLen(min_length=1)])]#
- author: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Dynamic field parsed from event', metadata=[MinLen(min_length=1)])]#