28 lines
630 B
Go
28 lines
630 B
Go
// Fantasy World Zookeeper Bot
|
|
// Copyright (c) 2018 Vladimir "fat0troll" Hodakov
|
|
|
|
package battlesv1
|
|
|
|
import (
|
|
"github.com/rs/zerolog"
|
|
"lab.wtfteam.pro/fat0troll/fw_zookeeper/context"
|
|
"lab.wtfteam.pro/fat0troll/fw_zookeeper/internal/router"
|
|
"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()
|
|
|
|
fightRegex := regexp.MustCompile(`@FWorldBot\s(.*)fight_(.{12})$`)
|
|
router.RegisterPrivateRegexp(fightRegex, ForwardCommand)
|
|
|
|
log.Info().Msg("Domain «battles» initialized")
|
|
}
|