<commit_before>// Package bot is a Hubot style bot that sits a microservice environment
package bot

import (
	"context"
	"fmt"
	"os"
	"regexp"
	"sort"
	"strings"
	"sync"
	"time"

	"github.com/micro/cli"
	"github.com/micro/go-micro"

	"github.com/micro/go-bot/command"
	"github.com/micro/go-bot/input"
	_ "github.com/micro/go-bot/input/hipchat"
	_ "github.com/micro/go-bot/input/slack"
	"github.com/micro/go-log"
	botc "github.com/micro/micro/internal/command/bot"

	proto "github.com/micro/go-bot/proto"
)

type bot struct {
	exit    chan bool
	ctx     *cli.Context
	service micro.Service

	sync.RWMutex
	inputs   map[string]input.Input
	commands map[string]command.Command
	services map[string]string
}

var (
	// Default server name
	Name = "go.micro.bot"
	// Namespace for commands
	Namespace = "go.micro.bot"
	// map pattern:command
	commands = map[string]func(*cli.Context) command.Command{
		"^echo ":                             botc.Echo,
		"^time$":                             botc.Time,
		"^hello$":                            botc.Hello,
		"^ping$":                             botc.Ping,
		"^list ":                             botc.List,
		"^get ":                              botc.Get,
		"^health ":                           botc.Health,
		"^call ":                             botc.Call,
		"^query ":                            botc.Call,
		"^register ":                         botc.Register,
		"^deregister ":                       botc.Deregister,
		"^(the )?three laws( of robotics)?$": botc.ThreeLaws,
	}<commit_msg>remove query<commit_after>// Package bot is a Hubot style bot that sits a microservice environment
package bot

import (
	"context"
	"fmt"
	"os"
	"regexp"
	"sort"
	"strings"
	"sync"
	"time"

	"github.com/micro/cli"
	"github.com/micro/go-micro"

	"github.com/micro/go-bot/command"
	"github.com/micro/go-bot/input"
	_ "github.com/micro/go-bot/input/hipchat"
	_ "github.com/micro/go-bot/input/slack"
	"github.com/micro/go-log"
	botc "github.com/micro/micro/internal/command/bot"

	proto "github.com/micro/go-bot/proto"
)

type bot struct {
	exit    chan bool
	ctx     *cli.Context
	service micro.Service

	sync.RWMutex
	inputs   map[string]input.Input
	commands map[string]command.Command
	services map[string]string
}

var (
	// Default server name
	Name = "go.micro.bot"
	// Namespace for commands
	Namespace = "go.micro.bot"
	// map pattern:command
	commands = map[string]func(*cli.Context) command.Command{
		"^echo ":                             botc.Echo,
		"^time$":                             botc.Time,
		"^hello$":                            botc.Hello,
		"^ping$":                             botc.Ping,
		"^list ":                             botc.List,
		"^get ":                              botc.Get,
		"^health ":                           botc.Health,
		"^call ":                             botc.Call,
		"^register ":                         botc.Register,
		"^deregister ":                       botc.Deregister,
		"^(the )?three laws( of robotics)?$": botc.ThreeLaws,
	}
{'fraction_non_alphanumeric': 0.13606340819022458, 'fraction_numerical': 0.0, 'mean_word_length': 1.791705069124424, 'pattern_counts': {'":': 23, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '699602', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1019, 'n_words': 191}