Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cjoudrey/go-irc-bot
IRC bot written in go that is scriptable with Lua
https://github.com/cjoudrey/go-irc-bot
Last synced: 12 days ago
JSON representation
IRC bot written in go that is scriptable with Lua
- Host: GitHub
- URL: https://github.com/cjoudrey/go-irc-bot
- Owner: cjoudrey
- License: mit
- Created: 2015-04-03T01:51:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-10T04:21:34.000Z (over 9 years ago)
- Last Synced: 2023-03-23T12:55:10.397Z (almost 2 years ago)
- Language: Go
- Homepage:
- Size: 180 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-irc-bot
`go-irc-bot` is a IRC bot written in go that is scriptable with Lua.
**This is still work in progress and should probably not be used in production. This was really just written as a learning exercise.**
## Usage
```
Usage: ./go-irc-bot [options...]Options:
-host="irc.freenode.net": host to connect to
-ident="go-irc-bot": ident
-nickname="go-irc-bot": nickname
-password="": password
-port=6667: port to connect to
-realname="go-irc-bot": realname
-secure=false: connect over tls
```## Scripting API
A [Lua5.1 VM](http://www.lua.org/manual/5.1/) is provided via [yuin/gopher-lua](https://github.com/yuin/gopher-lua) to script the bot.
A `bot` table is also exposed to control the bot within the VM.
#### bot.write(data)
Send a command to the IRC server.
i.e. `bot.write("JOIN #go-nuts")`
#### bot.on(event, callback(prefix, params))
Bind a handler to a given event.
Events map directly to what the IRC server sends to the client. For instance, if server sends `PRIVMSG` the event will be `PRIVMSG`.
An event can have many handlers.
`prefix` is the IRC message prefix.
`params` is a table of message arguments.