Browse Source

fix branch test, clean up mroleplay.

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

4
handle_test.go

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

6
handlers/mroleplay.go

@ -52,9 +52,9 @@ func MRoleplay(event *irc.Event, client *irc.Client) {
cuts := ircutil.CutMessage(text, overhead) cuts := ircutil.CutMessage(text, overhead)
for _, cut := range cuts { 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) client.SendQueuedf("%s %s %s :%s", npcCommand, channel.Name(), nick, cut)

Loading…
Cancel
Save