summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lrstanley/girc/commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/lrstanley/girc/commands.go')
-rw-r--r--vendor/github.com/lrstanley/girc/commands.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/github.com/lrstanley/girc/commands.go b/vendor/github.com/lrstanley/girc/commands.go
index 3f7d3bdc..d22f7616 100644
--- a/vendor/github.com/lrstanley/girc/commands.go
+++ b/vendor/github.com/lrstanley/girc/commands.go
@@ -272,6 +272,27 @@ func (cmd *Commands) Kick(channel, user, reason string) {
cmd.c.Send(&Event{Command: KICK, Params: []string{channel, user}})
}
+// Ban adds the +b mode on the given mask on a channel.
+func (cmd *Commands) Ban(channel, mask string) {
+ cmd.Mode(channel, "+b", mask)
+}
+
+// Unban removes the +b mode on the given mask on a channel.
+func (cmd *Commands) Unban(channel, mask string) {
+ cmd.Mode(channel, "-b", mask)
+}
+
+// Mode sends a mode change to the server which should be applied to target
+// (usually a channel or user), along with a set of modes (generally "+m",
+// "+mmmm", or "-m", where "m" is the mode you want to change). Params is only
+// needed if the mode change requires a parameter (ban or invite-only exclude.)
+func (cmd *Commands) Mode(target, modes string, params ...string) {
+ out := []string{target, modes}
+ out = append(out, params...)
+
+ cmd.c.Send(&Event{Command: MODE, Params: out})
+}
+
// Invite sends a INVITE query to the server, to invite nick to channel.
func (cmd *Commands) Invite(channel string, users ...string) {
for i := 0; i < len(users); i++ {