mirror of
https://github.com/gissleh/irc.git
synced 2026-10-15 19:32:52 +00:00
fix branch test, clean up mroleplay.
This commit is contained in:
+4
-2
@@ -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) {
|
||||||
t.Log("Got:", event.Kind(), event.Verb())
|
if !handled {
|
||||||
|
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
|
||||||
|
|||||||
@@ -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"
|
npcCommand := "NPC"
|
||||||
if event.Verb() == "npcc" {
|
if isAction {
|
||||||
npcCommand = "NPC"
|
npcCommand = "NPCA"
|
||||||
}
|
}
|
||||||
|
|
||||||
client.SendQueuedf("%s %s %s :%s", npcCommand, channel.Name(), nick, cut)
|
client.SendQueuedf("%s %s %s :%s", npcCommand, channel.Name(), nick, cut)
|
||||||
|
|||||||
Reference in New Issue
Block a user