mirror of https://github.com/fluffle/goirc
Pattern matching in accesslist
This commit is contained in:
parent
652867410a
commit
e7f0113a5b
|
@ -46,6 +46,7 @@ Access related commands:
|
|||
- `remove raylu`: removes all of raylu's flags
|
||||
- `say text`: says text to the channel
|
||||
- `list`: lists all users and their access
|
||||
- `list raylu`: searches the access list for raylu
|
||||
|
||||
Op commands:
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ func accesslist(conn *irc.Conn, nick *irc.Nick, args, target string) {
|
|||
}
|
||||
|
||||
owner, err := auth.String(conn.Network, "owner")
|
||||
if err != nil {
|
||||
if err == nil && strings.Contains(owner, args) {
|
||||
say(conn, nick.Nick, "%s is the owner", owner)
|
||||
}
|
||||
|
||||
|
@ -95,9 +95,11 @@ func accesslist(conn *irc.Conn, nick *irc.Nick, args, target string) {
|
|||
return
|
||||
}
|
||||
for _, u := range users {
|
||||
flags, err := auth.String(section, u)
|
||||
if err == nil {
|
||||
say(conn, nick.Nick, "%s: %s", u, flags)
|
||||
if strings.Contains(u, args) {
|
||||
flags, err := auth.String(section, u)
|
||||
if err == nil {
|
||||
say(conn, nick.Nick, "%s: %s", u, flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue