Browse Source

fix branch test, clean up mroleplay.

master
Gisle Aune 5 years ago
parent
commit
480c658139
  1. 6
      handle_test.go
  2. 6
      handlers/mroleplay.go

6
handle_test.go

@ -18,8 +18,10 @@ func TestHandle(t *testing.T) {
event := irc.NewEvent("test", eventName)
handled := false
irc.AddHandler(func(event *irc.Event, client *irc.Client) {
t.Log("Got:", event.Kind(), event.Verb())
client.AddHandler(func(event *irc.Event, client *irc.Client) {
if !handled {
t.Log("Got:", event.Kind(), event.Verb())
}
if event.Kind() == "test" && event.Verb() == eventName {
handled = true

6
handlers/mroleplay.go

@ -52,9 +52,9 @@ func MRoleplay(event *irc.Event, client *irc.Client) {
cuts := ircutil.CutMessage(text, overhead)
for _, cut := range cuts {
npcCommand := "NPCA"
if event.Verb() == "npcc" {
npcCommand = "NPC"
npcCommand := "NPC"
if isAction {
npcCommand = "NPCA"
}
client.SendQueuedf("%s %s %s :%s", npcCommand, channel.Name(), nick, cut)

Loading…
Cancel
Save