Spaces:
Paused
Paused
File size: 725 Bytes
49b198e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 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)
}
}
} |