<commit_before>package plugins

import (
	"../ircclient"
	"strings"
)

type AdminPlugin struct {
	ic *ircclient.IRCClient
}

func (q *AdminPlugin) Register(cl *ircclient.IRCClient) {
	q.ic = cl
	q.ic.RegisterCommandHandler("inviteme", 1, 400, q)
}

func (q *AdminPlugin) String() string {
	return "admin"
}

func (q *AdminPlugin) Info() string {
	return "provides commands for bot-admins"
}

func (q *AdminPlugin) Usage(cmd string) string {
	switch cmd {
	case "inviteme":
		return "inviteme <chanelname>"
	}
	return ""
}

func (q *AdminPlugin) ProcessLine(msg *ircclient.IRCMessage) {
	if msg.Command != "JOIN" {
		return
	}
	if q.ic.GetAccessLevel(msg.Source) >= 200 {
		q.ic.SendLine("MODE " + msg.Target + " +o " + strings.SplitN(msg.Source, "!", 2)[0])
		return
	}
}

func (q *AdminPlugin) ProcessCommand(cmd *ircclient.IRCCommand) {
	q.ic.SendLine("INVITE " + strings.SplitN(cmd.Source, "!", 2)[0] + " " + cmd.Args[0])
}

func (q *AdminPlugin) Unregister() {
	return
}<commit_msg>added a say, notice and action command<commit_after>package plugins

import (
	"../ircclient"
	"strings"
)

type AdminPlugin struct {
	ic *ircclient.IRCClient
}

func (q *AdminPlugin) Register(cl *ircclient.IRCClient) {
	q.ic = cl

	q.ic.RegisterCommandHandler("inviteme", 1, 400, q)
	q.ic.RegisterCommandHandler("say", 2, 500, q)
	q.ic.RegisterCommandHandler("notice", 2, 500, q)
	q.ic.RegisterCommandHandler("action", 2, 500, q)
}

func (q *AdminPlugin) String() string {
	return "admin"
}

func (q *AdminPlugin) Info() string {
	return "provides commands for bot-admins"
}

func (q *AdminPlugin) Usage(cmd string) string {
	switch cmd {
	case "inviteme":
		return "inviteme <channelname>"
	case "say":
		return "say <channelname> <message>"
	case "notice":
		return "notice <channelname> <message>"
	case "action":
		return "action <channelname> <message>"
	}
	return ""
}

func (q *AdminPlugin) ProcessLine(msg *ircclient.IRCMessage) {
	if msg.Command != "JOIN" {
		return
	}
	if q.ic.GetAccessLevel(msg.Source) >= 200 {
		q.ic.SendLine("MODE " + msg.Target + " +o " + strings.SplitN(msg.Source, "!", 2)[0])
		return
	}
}

func (q *AdminPlugin) ProcessCommand(cmd *ircclient.IRCCommand) {
	switch cmd.Command {
	case "inviteme":
		q.ic.SendLine("INVITE " + strings.SplitN(cmd.Source, "!", 2)[0] + " " + cmd.Args[0])
	case "say":
		q.ic.SendLine("PRIVMSG " + cmd.Args[0] + " :" + strings.Join(cmd.Args[1:], " "))
	case "notice":
		q.ic.SendLine("NOTICE " + cmd.Args[0] + " :" + strings.Join(cmd.Args[1:], " "))
	case "action":
		q.ic.SendLine("PRIVMSG " + cmd.Args[0] + " :\001ACTION " + strings.Join(cmd.Args[1:], " ") + "\001")
	}
}

func (q *AdminPlugin) Unregister() {
	return
}
{'fraction_non_alphanumeric': 0.17821040808685887, 'fraction_numerical': 0.017970797454137027, 'mean_word_length': 4.312127236580517, 'pattern_counts': {'":': 9, '<': 11, '<?xml version=': 0, '>': 13, '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': '1162216', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1033, 'n_words': 225}