Config
Config ¶
Bases: BaseModel
The configuration for SignalBot.
Attributes:
| Name | Type | Description |
|---|---|---|
signal_service |
str
|
The URL of the |
phone_number |
str
|
The phone number of the bot. |
storage |
RedisConfig | SQLiteConfig | InMemoryConfig | None
|
The configuration for the storage backend to use. Defaults to |
retry_interval |
int
|
The interval in seconds to wait before retrying a failed connection to the signal service. |
download_attachments |
bool
|
Whether to download attachments from messages. Defaults to
|
connection_mode |
ConnectionMode
|
The connection mode to use when connecting to the Signal
service. Defaults to |
Source code in src/signalbot/bot_config.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
InMemoryConfig ¶
Bases: BaseModel
The configuration for the in-memory storage backend.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['in-memory']
|
The type of storage. |
Source code in src/signalbot/bot_config.py
43 44 45 46 47 48 49 50 51 | |
RedisConfig ¶
Bases: BaseModel
The configuration for the Redis storage backend.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['redis']
|
The type of storage. |
redis_host |
str
|
The hostname of the Redis server. |
redis_port |
int
|
The port number of the Redis server. |
Source code in src/signalbot/bot_config.py
13 14 15 16 17 18 19 20 21 22 23 24 25 | |
SQLiteConfig ¶
Bases: BaseModel
The configuration for the SQLite storage backend.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['sqlite']
|
The type of storage. |
sqlite_db |
str | Path
|
The path to the SQLite database file. |
check_same_thread |
bool
|
Whether to check the same thread when accessing the database. |
Source code in src/signalbot/bot_config.py
28 29 30 31 32 33 34 35 36 37 38 39 40 | |
ConnectionMode ¶
Protocol strategy for connecting to signal-cli-rest-api.
Attributes:
| Name | Type | Description |
|---|---|---|
HTTPS_ONLY |
Always use HTTPS/WSS. |
|
HTTP_ONLY |
Always use HTTP/WS. |
|
AUTO |
Start with HTTPS/WSS and fallback to HTTP/WS if unavailable. |
Source code in src/signalbot/api.py
14 15 16 17 18 19 20 21 22 23 24 25 | |