|
@ -17,7 +17,7 @@ func Input(event *irc.Event, client *irc.Client) { |
|
|
|
|
|
|
|
|
targetName, text := ircutil.ParseArgAndText(event.Text) |
|
|
targetName, text := ircutil.ParseArgAndText(event.Text) |
|
|
if targetName == "" || text == "" { |
|
|
if targetName == "" || text == "" { |
|
|
client.EmitNonBlocking(irc.NewErrorEvent("input", "Usage: /msg <target> <text...>")) |
|
|
|
|
|
|
|
|
client.EmitNonBlocking(irc.NewErrorEventTarget(event.Target(), "input", "Usage: /msg <target> <text...>", "usage_msg", nil)) |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -34,13 +34,13 @@ func Input(event *irc.Event, client *irc.Client) { |
|
|
event.PreventDefault() |
|
|
event.PreventDefault() |
|
|
|
|
|
|
|
|
if event.Text == "" { |
|
|
if event.Text == "" { |
|
|
client.EmitNonBlocking(irc.NewErrorEvent("input", "Usage: /text <text...>")) |
|
|
|
|
|
|
|
|
client.EmitNonBlocking(irc.NewErrorEventTarget(event.Target(), "input", "Usage: /text <text...>", "usage_text", nil)) |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
target := event.Target("query", "channel") |
|
|
target := event.Target("query", "channel") |
|
|
if target == nil { |
|
|
if target == nil { |
|
|
client.EmitNonBlocking(irc.NewErrorEvent("input", "Target is not a channel or query")) |
|
|
|
|
|
|
|
|
client.EmitNonBlocking(irc.NewErrorEventTarget(event.Target(), "input", "Target is not a channel or query", "target_not_channel_or_query", nil)) |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -57,13 +57,13 @@ func Input(event *irc.Event, client *irc.Client) { |
|
|
event.PreventDefault() |
|
|
event.PreventDefault() |
|
|
|
|
|
|
|
|
if event.Text == "" { |
|
|
if event.Text == "" { |
|
|
client.EmitNonBlocking(irc.NewErrorEvent("input", "Usage: /me <text...>")) |
|
|
|
|
|
|
|
|
client.EmitNonBlocking(irc.NewErrorEventTarget(event.Target(), "input", "Usage: /me <text...>", "usage_me", nil)) |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
target := event.Target("query", "channel") |
|
|
target := event.Target("query", "channel") |
|
|
if target == nil { |
|
|
if target == nil { |
|
|
client.EmitNonBlocking(irc.NewErrorEvent("input", "Target is not a channel or query")) |
|
|
|
|
|
|
|
|
client.EmitNonBlocking(irc.NewErrorEventTarget(event.Target(), "input", "Target is not a channel or query", "target_not_channel_or_query", nil)) |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -93,7 +93,7 @@ func Input(event *irc.Event, client *irc.Client) { |
|
|
|
|
|
|
|
|
targetName, text := ircutil.ParseArgAndText(event.Text) |
|
|
targetName, text := ircutil.ParseArgAndText(event.Text) |
|
|
if targetName == "" || text == "" { |
|
|
if targetName == "" || text == "" { |
|
|
client.EmitNonBlocking(irc.NewErrorEvent("input", "Usage: /describe <target> <text...>")) |
|
|
|
|
|
|
|
|
client.EmitNonBlocking(irc.NewErrorEventTarget(event.Target(), "input", "Usage: /describe <target> <text...>", "usage_describe", nil)) |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -122,7 +122,7 @@ func Input(event *irc.Event, client *irc.Client) { |
|
|
event.PreventDefault() |
|
|
event.PreventDefault() |
|
|
|
|
|
|
|
|
if event.Text == "" { |
|
|
if event.Text == "" { |
|
|
client.EmitNonBlocking(irc.NewErrorEvent("input", "Usage: /m <modes and args...>")) |
|
|
|
|
|
|
|
|
client.EmitNonBlocking(irc.NewErrorEventTarget(event.Target(), "input", "Usage: /m <modes and args...>", "usage_m", nil)) |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -131,7 +131,7 @@ func Input(event *irc.Event, client *irc.Client) { |
|
|
} else if status := event.StatusTarget(); status != nil { |
|
|
} else if status := event.StatusTarget(); status != nil { |
|
|
client.SendQueuedf("MODE %s %s", client.Nick(), event.Text) |
|
|
client.SendQueuedf("MODE %s %s", client.Nick(), event.Text) |
|
|
} else { |
|
|
} else { |
|
|
client.EmitNonBlocking(irc.NewErrorEvent("input", "Target is not a channel or status")) |
|
|
|
|
|
|
|
|
client.EmitNonBlocking(irc.NewErrorEventTarget(event.Target(), "input", "Target is not a channel or status", "channel_not_channel_or_status", nil)) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|