cligram.config
Application configuration management.
- class cligram.config.AppConfig(delays=<factory>, verbose=False)[source]
Bases:
objectMain application behavior configuration.
-
delays:
DelaysConfig Delay timing configurations
-
delays:
- class cligram.config.Config(_config_path=PosixPath('/home/docs/.cligram/config.json'), app=<factory>, telegram=<factory>, scan=<factory>, interactive=<factory>, updated=False, overridden=False)[source]
Bases:
objectApplication configuration root.
- apply_override(override_str)[source]
Apply a configuration override using dot notation.
- Parameters:
override_str (
str) – Override string in format “path.to.key=value” Examples: “app.verbose=true”, “scan.limit=200”- Raises:
ValueError – If override string is invalid
- classmethod from_file(config_path='config.json', overrides=None)[source]
Load configuration from JSON file.
- Return type:
- get_nested_value(path, bypass_interceptor=False)[source]
Get a nested configuration value using dot notation.
- Parameters:
- Return type:
- Returns:
Value at the specified path
- Raises:
ValueError – If path is invalid
-
interactive:
InteractiveConfig Interactive mode settings
-
scan:
ScanConfig Scanning behavior and timing settings
- set_nested_value(path, value, bypass_interceptor=False)[source]
Set a nested configuration value using dot notation.
- Parameters:
- Raises:
ValueError – If path is invalid
-
telegram:
TelegramConfig Telegram client and connection settings
- class cligram.config.ConnectionConfig(direct=True, proxies=<factory>)[source]
Bases:
objectConnection settings for Telegram client.
- class cligram.config.DelayConfig(min=10.0, max=20.0)[source]
Bases:
objectDelay interval configuration.
- class cligram.config.DelaysConfig(normal=<factory>, long=<factory>)[source]
Bases:
objectDelay timing configuration.
-
long:
LongDelayConfig Long break delay settings
-
normal:
DelayConfig Normal delay settings
-
long:
- class cligram.config.InteractiveConfig(mode=InteractiveMode.CLIGRAM)[source]
Bases:
objectInteractive mode configuration.
-
mode:
InteractiveMode= 'cligram' The interactive mode to use
-
mode:
- class cligram.config.InteractiveMode(*values)[source]
Bases:
EnumInteractive mode options.
- CLIGRAM = 'cligram'
Interactive mode with Cligram commands
- PYTHON = 'python'
Interactive mode with Python code execution
- class cligram.config.LongDelayConfig(min=30.0, max=60.0, chance=0.1)[source]
Bases:
DelayConfigConfiguration for long delay periods.
- class cligram.config.MessagesConfig(source='me', limit=20, msg_id=None)[source]
Bases:
objectConfiguration for message forwarding.
- class cligram.config.PathInfo(config_path, is_global, base_path, data_path, session_path)[source]
Bases:
object-
base_path:
Path Base directory for storing Cligram data.
-
config_path:
Path Path to the configuration file.
-
data_path:
Path Directory for application state (and sessions if not global).
-
session_path:
Path Path to the session files for the current api configuration.
-
base_path:
- class cligram.config.ScanConfig(messages=<factory>, mode=ScanMode.FULL, targets=<factory>, limit=50, test=False, rapid_save=False)[source]
Bases:
objectConfiguration for scanning behavior and timing.
-
messages:
MessagesConfig Message forwarding settings
-
messages:
- class cligram.config.ScanMode(*values)[source]
Bases:
EnumOperation modes for the scanner.
- FULL = 'full'
scans and sends messages to targets.
- Type:
Full operation mode
- HALT = 'halt'
logs in to telegram and shuts down.
- Type:
Halt mode
- LOGOUT = 'logout'
logs out from the Telegram and deletes the session file.
- Type:
Logout mode
- RECEIVE = 'receive'
receives and shows new messages.
- Type:
Receive mode
- SCAN = 'scan'
only scans and stores eligible usernames without sending.
- Type:
Scan mode
- SEND = 'send'
only sends messages to eligible usernames without scanning.
- Type:
Send mode
- class cligram.config.StartupConfig(count_unread_messages=True)[source]
Bases:
objectTelegram client startup settings.
- class cligram.config.TelegramConfig(api=<factory>, connection=<factory>, startup=<factory>, session='default', impersonate=False)[source]
Bases:
objectTelegram client settings.
-
connection:
ConnectionConfig Connection settings
-
startup:
StartupConfig Startup behavior settings
-
connection: