diff options
| author | s <[email protected]> | 2025-11-25 09:38:31 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-25 09:38:31 -0500 |
| commit | 8472267b60b204cea5fbdeaf8fe06443822d1bfb (patch) | |
| tree | eba71104733067072ded109bf96904cd825c2f7f /internal/client/telegram.go | |
| parent | bc31d9cc8f93a5efef958872f48f3f4370ed5e29 (diff) | |
| download | dborg-8472267b60b204cea5fbdeaf8fe06443822d1bfb.tar.gz dborg-8472267b60b204cea5fbdeaf8fe06443822d1bfb.zip | |
feat: add crypto analysis, email verification, and telegram lookup commands
Diffstat (limited to 'internal/client/telegram.go')
| -rw-r--r-- | internal/client/telegram.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/internal/client/telegram.go b/internal/client/telegram.go new file mode 100644 index 0000000..33b4ac2 --- /dev/null +++ b/internal/client/telegram.go @@ -0,0 +1,28 @@ +package client + +import ( + "encoding/json" + "fmt" + "git.db.org.ai/dborg/internal/models" + "strings" +) + +func (c *Client) GetTelegramPhone(identifier string) (*models.TelegramPhoneResponse, error) { + identifier = strings.TrimSpace(identifier) + if identifier == "" { + return nil, fmt.Errorf("identifier cannot be empty") + } + + path := fmt.Sprintf("/telegram/phone/%s", identifier) + data, err := c.Get(path, nil) + if err != nil { + return nil, err + } + + var response models.TelegramPhoneResponse + if err := json.Unmarshal(data, &response); err != nil { + return nil, fmt.Errorf("failed to parse telegram response: %w", err) + } + + return &response, nil +} |
