Skip to content

Commit

Permalink
Added 'kick' action to IRCBee
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Aug 1, 2018
1 parent f6ac3ac commit 8569a4a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bees/ircbee/ircbee.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ func (mod *IrcBee) Action(action bees.Action) []bees.Placeholder {
}
}

case "kick":
var c, n, m string
action.Options.Bind("channel", &c)
action.Options.Bind("user", &n)
action.Options.Bind("message", &m)
mod.client.Kick(c, n, m)

default:
panic("Unknown action triggered in " + mod.Name() + ": " + action.Name)
}
Expand Down
24 changes: 24 additions & 0 deletions bees/ircbee/ircbeefactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,30 @@ func (factory *IrcBeeFactory) Actions() []bees.ActionDescriptor {
},
},
},
{
Namespace: factory.Name(),
Name: "kick",
Description: "Kicks a user from a channel",
Options: []bees.PlaceholderDescriptor{
{
Name: "user",
Description: "User to kick",
Type: "string",
Mandatory: true,
},
{
Name: "channel",
Description: "Channel to kick from",
Type: "string",
Mandatory: true,
},
{
Name: "message",
Description: "Kick message",
Type: "string",
},
},
},
}
return actions
}
Expand Down

0 comments on commit 8569a4a

Please sign in to comment.