<commit_before>// Copyright 2014, Truveris Inc. All Rights Reserved.
// Use of this source code is governed by the ISC license in the LICENSE file.

package main

import (
	//	"fmt"
	"strings"

	"github.com/truveris/ygor"
)

type XombreroModule struct{}

func (module XombreroModule) PrivMsg(msg *ygor.Message) {
	if len(msg.Args) == 0 {
		IRCPrivMsg(msg.ReplyTo, "usage: xombrero [command [param ...]]")
		return
	}

	SendToChannelMinions(msg.ReplyTo, "xombrero "+strings.Join(msg.Args, " "))
}

// func (module XombreroModule) MinionMsg(msg *ygor.MinionMsg) {
// 	if msg.Args[0] == "ok" {
// 		channels := GetChannelsByMinionName(msg.Name)
// 		for _, channel := range channels {
// 			s := fmt.Sprintf("%s: %s", msg.Name, okWord())
// 			IRCPrivMsg(channel, s)
// 		}
// 	}
// }

func (module XombreroModule) Init() {
	ygor.RegisterCommand(ygor.Command{
		Name:            "xombrero",
		PrivMsgFunction: module.PrivMsg,
		// MinionMsgFunction: module.MinionMsg,
		Addressed:    true,
		AllowPrivate: false,
		AllowChannel: true,
	})
}<commit_msg>Create a default 'web' command for 'xombrero open'.<commit_after>// Copyright 2014, Truveris Inc. All Rights Reserved.
// Use of this source code is governed by the ISC license in the LICENSE file.

package main

import (
	//	"fmt"
	"strings"

	"github.com/truveris/ygor"
)

type XombreroModule struct{}

// Send the xombrero command to the minions.
func (module XombreroModule) PrivMsg(msg *ygor.Message) {
	if len(msg.Args) == 0 {
		IRCPrivMsg(msg.ReplyTo, "usage: xombrero [command [param ...]]")
		return
	}

	SendToChannelMinions(msg.ReplyTo, "xombrero "+strings.Join(msg.Args, " "))
}

// Shortcut for xombrero open.
func (module XombreroModule) WebPrivMsg(msg *ygor.Message) {
	if len(msg.Args) != 1 {
		IRCPrivMsg(msg.ReplyTo, "usage: web url")
		return
	}

	SendToChannelMinions(msg.ReplyTo, "xombrero open "+msg.Args[0])
}

// func (module XombreroModule) MinionMsg(msg *ygor.MinionMsg) {
// 	if msg.Args[0] == "ok" {
// 		channels := GetChannelsByMinionName(msg.Name)
// 		for _, channel := range channels {
// 			s := fmt.Sprintf("%s: %s", msg.Name, okWord())
// 			IRCPrivMsg(channel, s)
// 		}
// 	}
// }

func (module XombreroModule) Init() {
	ygor.RegisterCommand(ygor.Command{
		Name:            "xombrero",
		PrivMsgFunction: module.PrivMsg,
		// MinionMsgFunction: module.MinionMsg,
		Addressed:    true,
		AllowPrivate: false,
		AllowChannel: true,
	})

	ygor.RegisterCommand(ygor.Command{
		Name:            "web",
		PrivMsgFunction: module.WebPrivMsg,
		Addressed:    true,
		AllowPrivate: false,
		AllowChannel: true,
	})
}
{'fraction_non_alphanumeric': 0.148747591522158, 'fraction_numerical': 0.005394990366088632, 'mean_word_length': 3.5543859649122806, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7116760', 'n_tokens_mistral': 1027, 'n_tokens_neox': 975, 'n_words': 220}