This commit is contained in:
raylu 2010-11-05 19:28:32 -04:00
parent e7f0113a5b
commit ce090c674b
5 changed files with 30 additions and 9 deletions

View File

@ -5,7 +5,7 @@
include $(GOROOT)/src/Make.inc include $(GOROOT)/src/Make.inc
TARG=rbot TARG=rbot
GOFILES=rbot.go handler.go auth.go cmd-access.go cmd-op.go cmd-google.go GOFILES=rbot.go handler.go auth.go cmd-access.go cmd-admin.go cmd-op.go cmd-google.go
include $(GOROOT)/src/Make.cmd include $(GOROOT)/src/Make.cmd

View File

@ -44,10 +44,13 @@ Access related commands:
- `add raylu t`: gives raylu the t flag - `add raylu t`: gives raylu the t flag
- `remove raylu t`: removes the t flag from raylu - `remove raylu t`: removes the t flag from raylu
- `remove raylu`: removes all of raylu's flags - `remove raylu`: removes all of raylu's flags
- `say text`: says text to the channel
- `list`: lists all users and their access - `list`: lists all users and their access
- `list raylu`: searches the access list for raylu - `list raylu`: searches the access list for raylu
Admin commands:
- `nick john`: changes the bot's nick to john
- `say text`: says text to the channel
Op commands: Op commands:
- `halfop|hop`: halfop yourself - `halfop|hop`: halfop yourself

View File

@ -103,10 +103,3 @@ func accesslist(conn *irc.Conn, nick *irc.Nick, args, target string) {
} }
} }
} }
func csay(conn *irc.Conn, nick *irc.Nick, args, target string) {
channel, args := parseAccess(conn, nick, target, args, "s")
if channel != "" {
say(conn, channel, args)
}
}

22
cmd-admin.go Normal file
View File

@ -0,0 +1,22 @@
package main
import (
"irc"
)
func nick(conn *irc.Conn, nick *irc.Nick, args, target string) {
if len(args) == 0 {
return
}
owner, _ := auth.String(conn.Network, "owner");
if owner == user(nick) {
conn.Nick(args)
}
}
func csay(conn *irc.Conn, nick *irc.Nick, args, target string) {
channel, args := parseAccess(conn, nick, target, args, "s")
if len(channel) > 0 {
say(conn, channel, args)
}
}

View File

@ -15,6 +15,9 @@ var commands = map [string]func(*irc.Conn, *irc.Nick, string, string) {
"add": add, "add": add,
"remove": remove, "remove": remove,
"list": accesslist, "list": accesslist,
// admin
"nick": nick,
"say": csay, "say": csay,
// op // op