add new bonus system

This commit is contained in:
Smile Rex
2025-03-03 19:13:34 +03:00
parent 26746aeaca
commit 94b43f7341
2 changed files with 100 additions and 1 deletions

27
main.go
View File

@@ -10,6 +10,11 @@ import (
tele "gopkg.in/telebot.v4"
)
// //////////////////////
var isTest bool = false
////////////////////////
func config() models.Config {
return models.Config{
Token: os.Getenv("BOT_TOKEN"),
@@ -20,8 +25,25 @@ func config() models.Config {
}
}
func testConfig() models.Config {
return models.Config{
Token: "7757765456:AAFpFXhbi9XCfgRt7P3OT3F_jrBBplubWZA",
HostName: "217.12.40.237",
DbName: "stage",
UserName: "root",
Password: "12641264",
}
}
func main() {
cfg := config()
var cfg models.Config
if isTest {
cfg = testConfig()
} else {
cfg = config()
}
pref := tele.Settings{
Token: cfg.Token,
Poller: &tele.LongPoller{Timeout: 10 * time.Second},
@@ -37,6 +59,7 @@ func main() {
dickController := controllers.NewDick(dc)
duelController := controllers.NewDuel(b, dc)
bonusController := controllers.NewBonusController(b, dc)
b.Handle("/dick", dickController.Dick)
b.Handle("/top_dick", dickController.TopDick)
@@ -45,5 +68,7 @@ func main() {
b.Handle("/accept", duelController.AcceptMatch)
b.Handle("/clear", duelController.ClearMatch)
b.Handle("/b", bonusController.Bonus)
b.Start()
}