This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues/pull-requests.
2018-11-29 22:15:21 +04:00
|
|
|
// Fantasy World Zookeeper Bot
|
|
|
|
// Copyright (c) 2018 Vladimir "fat0troll" Hodakov
|
|
|
|
|
|
|
|
package battlesv1
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/rs/zerolog"
|
2019-10-08 09:13:54 +04:00
|
|
|
"source.hodakov.me/fat0troll/fwzookeeper/context"
|
|
|
|
"source.hodakov.me/fat0troll/fwzookeeper/internal/router"
|
2018-11-29 22:15:21 +04:00
|
|
|
"regexp"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
c *context.Context
|
|
|
|
log zerolog.Logger
|
|
|
|
)
|
|
|
|
|
|
|
|
// New initializes package
|
|
|
|
func New(cc *context.Context) {
|
|
|
|
c = cc
|
|
|
|
log = c.Logger.With().Str("domain", "battles").Int("version", 1).Logger()
|
|
|
|
|
2018-11-29 23:24:13 +04:00
|
|
|
fightRegexWithoutBot := regexp.MustCompile(`(.*)fight_(.{12})$`)
|
|
|
|
router.RegisterPrivateRegexp(fightRegexWithoutBot, ForwardCommand)
|
2018-11-29 22:15:21 +04:00
|
|
|
|
|
|
|
log.Info().Msg("Domain «battles» initialized")
|
|
|
|
}
|