diff options
author | Wim <wim@42.be> | 2017-12-02 23:58:02 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2017-12-02 23:58:02 +0100 |
commit | 788d3b32ac50430ee38feb996d068860beaa679e (patch) | |
tree | 51d0fdf1b9fa70c25cda534a2bfe866ac57804ae /vendor/github.com/lrstanley/girc/commands.go | |
parent | 1d414cf2fdbbf642307bea81756d95b6793a0f9d (diff) | |
download | matterbridge-msglm-788d3b32ac50430ee38feb996d068860beaa679e.tar.gz matterbridge-msglm-788d3b32ac50430ee38feb996d068860beaa679e.tar.bz2 matterbridge-msglm-788d3b32ac50430ee38feb996d068860beaa679e.zip |
Update vendor lrstanley/girc and readme
Diffstat (limited to 'vendor/github.com/lrstanley/girc/commands.go')
-rw-r--r-- | vendor/github.com/lrstanley/girc/commands.go | 21 |
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++ { |