Compare commits

...

2 Commits

15 changed files with 5941 additions and 0 deletions

2
.gitignore vendored
View File

@@ -0,0 +1,2 @@
.vscode
*.bkp

3
bot/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module lirqetes.ru/thelanc3/laura
go 1.25.4

37
bot/main.go Normal file
View File

@@ -0,0 +1,37 @@
package main
import (
"context"
"time"
"lirqetes.ru/thelanc3/laura/queue"
)
func main() {
ctx := context.Background()
actions := make(chan queue.BotAction, 200)
go actionsWorker(ctx, actions, 34*time.Millisecond)
}
func actionsWorker(
ctx context.Context,
actions <-chan queue.BotAction,
interval time.Duration,
) {
ticker := time.NewTicker(interval)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
{
return
}
case action := <-actions:
{
<-ticker.C
action(ctx)
}
}
}
}

View File

View File

5
bot/queue/bot_action.go Normal file
View File

@@ -0,0 +1,5 @@
package queue
import "context"
type BotAction func(ctx context.Context)

View File

18
schemes.drawio Normal file
View File

@@ -0,0 +1,18 @@
<mxfile host="65bd71144e" pages="2">
<diagram name="db-scheme" id="omqtpuhYFdzVFIHnakk7">
<mxGraphModel dx="702" dy="611" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="none" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
</root>
</mxGraphModel>
</diagram>
<diagram id="TZAEEldzp1pVNTyIG9nr" name="lang-scheme">
<mxGraphModel dx="702" dy="611" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@@ -5,6 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>laura-admin-app</title>
<script src="https://telegram.org/js/telegram-web-app.js"></script>
</head>
<body>
<div id="root"></div>

2937
web/admin/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>laura-user-app</title>
<script src="https://telegram.org/js/telegram-web-app.js"></script>
</head>
<body>
<div id="root"></div>

2937
web/user/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff