Initial commit: FunStat MCP Server Go implementation

- Telegram integration for customer statistics
- MCP server implementation with rate limiting
- Cache system for performance optimization
- Multi-language support
- RESTful API endpoints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
你的用户名
2025-11-04 15:28:06 +08:00
commit 8d1ce4598d
18 changed files with 1940 additions and 0 deletions

22
internal/telegram/util.go Normal file
View File

@@ -0,0 +1,22 @@
package telegram
import (
"context"
"time"
)
func sleepWithContext(ctx context.Context, d time.Duration) error {
if d <= 0 {
return nil
}
timer := time.NewTimer(d)
defer timer.Stop()
select {
case <-ctx.Done():
return ctx.Err()
case <-timer.C:
return nil
}
}