Groups
GetGroupsError ¶
GroupEntry
pydantic-model
¶
Bases: GroupEntry
A group the bot is a member of, as returned by GroupRegistry.
Fields:
-
admins(list[str]) -
blocked(bool) -
description(str) -
id(str) -
internal_id(str) -
invite_link(str) -
members(list[str]) -
name(str) -
pending_invites(list[str]) -
pending_requests(list[str]) -
permissions(GroupPermissions)
GroupPermissions
pydantic-model
¶
Bases: GroupPermissions
Who is allowed to perform which actions in a group.
Fields:
-
add_members(AddMembers) -
edit_group(EditGroup) -
send_messages(SendMessages)
GroupRegistry ¶
GroupRegistry(signal: SignalAPI, logger: Logger)
List-like cache of the groups the bot is a member of, with lookup helpers.
To update a group's metadata, use actions (bot.groups.actions) instead.
Source code in src/signalbot/groups/registry.py
actions
instance-attribute
¶
actions: GroupActions
Update group metadata. Set by SignalBot._init_actions().
get ¶
get(internal_id: str) -> GroupEntry | None
Look up a cached group by its internal id, without hitting the network.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
internal_id
|
str
|
The group's internal id, as used by |
required |
Returns:
| Type | Description |
|---|---|
GroupEntry | None
|
The cached |
Source code in src/signalbot/groups/registry.py
get_id ¶
Look up a group's canonical id by its internal id, without copying
the full GroupEntry. For hot-path callers (e.g. per-message,
per-handler dispatch checks) that only need the id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
internal_id
|
str
|
The group's internal id. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The group's canonical id, or |
Source code in src/signalbot/groups/registry.py
GroupUpdate
pydantic-model
¶
Bases: BaseMessage
Notification that a group's metadata (name, members, ...) was updated.
Fields:
-
server_delivered_timestamp(int) -
server_received_timestamp(int) -
source(str | None) -
source_device(int | None) -
source_name(str | None) -
source_number(str | None) -
source_uuid(str | None) -
timestamp(int) -
group_info(GroupUpdateInfo)
GroupUpdateInfo
pydantic-model
¶
UpdateGroup
pydantic-model
¶
Bases: BaseModel
The fields to change on a group. If a field is None, it is left unchanged.
Fields:
-
avatar(PydanticPath | str | None) -
description(str | None) -
expiration_in_seconds(int | None) -
group_link(GroupLink | None) -
name(str | None) -
permissions(GroupPermissions | None)
avatar
pydantic-field
¶
avatar: PydanticPath | str | None = None
The new avatar of the group. This can be a Path or a base64 encoded string of the image content.
expiration_in_seconds
pydantic-field
¶
expiration_in_seconds: int | None = None
The new expiration time of the group in seconds.
group_link
pydantic-field
¶
group_link: GroupLink | None = None
Enable or disable joining the group via group link.
permissions
pydantic-field
¶
permissions: GroupPermissions | None = None
The new permissions for the group.