mirror of https://github.com/fluffle/goirc
nick
This commit is contained in:
parent
e7f0113a5b
commit
ce090c674b
2
Makefile
2
Makefile
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue