tgf / test_validator.go
Mohammad Shahid
feat(bot): Implement personal bot management and validation
49b198e
raw
history blame contribute delete
725 Bytes
package main
import (
"TelegramCloud/tgf/internal/bot"
"TelegramCloud/tgf/internal/utils"
"fmt"
)
func main() {
// Initialize logger
utils.InitLogger(true)
log := utils.Logger
// Test bot validator
validator := bot.NewBotValidator(log)
// Test cases
testTokens := []string{
"invalid_token",
"123:short",
"not_a_number:ABCdef123456789",
"123456789:ABCdef123456789012345678901234567890", // Valid format but fake
}
for _, token := range testTokens {
fmt.Printf("\nTesting token: %s\n", token)
botInfo, err := validator.ValidateBotToken(token)
if err != nil {
fmt.Printf("❌ Error: %v\n", err)
} else {
fmt.Printf("✅ Valid bot: @%s (ID: %d)\n", botInfo.Username, botInfo.ID)
}
}
}