add: :n username channelname\n ex: :n testuser #testchannel

This commit is contained in:
Martin Schlierf 2017-03-07 14:30:11 +01:00
parent 329a62d7d9
commit 21a7d8c22c
1 changed files with 7 additions and 1 deletions

View File

@ -12,7 +12,7 @@ import (
)
var host *string = flag.String("host", "irc.freenode.net", "IRC server")
var channel *string = flag.String("channel", "#go-nuts", "IRC channel")
var channel *string = flag.String("channel", "#momotest", "IRC channel")
func main() {
flag.Parse()
@ -55,6 +55,12 @@ func main() {
switch idx := strings.Index(cmd, " "); {
case cmd[1] == 'd':
fmt.Printf(c.String())
case cmd[1] == 'n':
parts := strings.Split(cmd," ")
username := strings.TrimSpace(parts[1])
channelname := strings.TrimSpace(parts[2])
_, userIsOn := c.StateTracker().IsOn(channelname,username)
fmt.Printf("Checking if %s is in %s Online: %t\n", username, channelname, userIsOn)
case cmd[1] == 'f':
if len(cmd) > 2 && cmd[2] == 'e' {
// enable flooding