- Add telego v1.8.0 dependency for Telegram Bot API - Create pkg/bot package with Bot struct holding engine, verifier, recon, storage, registry deps - Implement 8 command handlers: /help, /scan, /verify, /recon, /status, /stats, /providers, /key - /key enforced private-chat-only for security (never exposes unmasked keys in groups) - All other commands use masked keys only - Handler registration via telego's BotHandler with CommandEqual predicates
22 lines
515 B
Go
22 lines
515 B
Go
package bot
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/salvacybersec/keyhunter/pkg/engine/sources"
|
|
)
|
|
|
|
// selectBotSource returns the appropriate Source for a bot scan request.
|
|
// Only file and directory paths are supported (no git, stdin, clipboard, URL).
|
|
func selectBotSource(path string) (sources.Source, error) {
|
|
info, err := os.Stat(path)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("stat %q: %w", path, err)
|
|
}
|
|
if info.IsDir() {
|
|
return sources.NewDirSource(path), nil
|
|
}
|
|
return sources.NewFileSource(path), nil
|
|
}
|