This POC has some good ideas. Let's turn it into an actual project.
Scope
Basic event handling (see Events below)
Basic command support (see Commands below)
We should properly handle server responses (say, if a user attempts to send a message to a channel they're not joined in)
Tests
Documentation (scoped out #3)
Out of scope
Maintaining network and channel state. Currently the bot is unaware of what channels its in, what users are in each channel, even what its own nick is. In the future we will want to surface this information in a nice way.
Compile errors (see Compile Errors). (#5)
Helper event handlers (see Helper Event Handlers) (#6)
Support for issuing IRC commands trigged by external events. (#7)
Or to put it another way: the system is closed. A user can define a bot that can react and respond to IRC events, such as rejoining a channel when kicked. There currently is no mechanism to say, join a specific channel on a specific network as a response to a web request.
Scoping this out now allows us to avoid the scoping issue this may present, where we define join macro that takes a context, how do we define a join that takes say, a network name and a channel. My initial idea was to scope the functions that take a context to those handlers (TBD if this is actually possible).
Extensibility. Users currently have no way to define their own hooks. It'd be nice if they could. (#8)
Events
[x] on_join
[x] on_privmsg
[x] on_kick- [ ] on_connect (scoped out #4)
[x] on_part
[ ] on_ping
[x] on_invite
Commands
[x] privmsg
[x] join
[ ] part
[ ] kick
[ ] ping
Compile Errors
Ideally we would raise a compiler error if the bot is misconfigured in some way. Here's a few things we could raise errors on:
If a channel block was defined outside of a network block
If the given handler for an event doesn't have an arity of one
If required configuration is not specified. For instance, a server must be specified in a network block.
Helper Event Handlers
We'll want to define some basic functionality that the user can then opt in/out of
This POC has some good ideas. Let's turn it into an actual project.
Scope
Documentation(scoped out #3)Out of scope
join
macro that takes a context, how do we define ajoin
that takes say, a network name and a channel. My initial idea was to scope the functions that take a context to those handlers (TBD if this is actually possible).Events
on_join
on_privmsg
on_kick
- [ ](scoped out #4)on_connect
on_part
on_ping
on_invite
Commands
privmsg
join
part
kick
ping
Compile Errors
Ideally we would raise a compiler error if the bot is misconfigured in some way. Here's a few things we could raise errors on:
channel
block was defined outside of anetwork
blockserver
must be specified in anetwork
block.Helper Event Handlers
We'll want to define some basic functionality that the user can then opt in/out of
rejoin_on_kick!
join_on_invitation!