Spaces:
Paused
Paused
| 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) | |
| } | |
| } | |
| } |