What is the best library for building an IRC bot in Java? [closed]
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
开发者_StackOverflowClosed 9 years ago.
Improve this questionIn particular, I'm trying to find a library that provides an elegant way to deal with the event-based nature of IRC, without producing spaghetti code (as a naive event-based implementation often becomes).
Netty is an event-driven IO framework you might want to look at.
irc-api, a well designed Java IRC API that offers some features other IRC APIs don't (like asynchronous commands). Main features are:
- State(ful/less) API
- Callbacks support / Asynchronous
- Message Listeners - Message Filters
- SSL implementation
- DCC implementation
- SLF4J/Maven integration
You might wanna give it a try!
I've already written such framework you mention in comment:
JawaBot 2.x is a pluggable standalone application with IRC and web UI which aims to put multiple functionalities under one bot, while still keeping the structure of the code sane. Mavenized.
Currently, there are few plugins:
- Jira - resolves name, status and assignee from a Jira issue tracker. Configurable. Default config supports opensource repos: JBoss, Codehaus, Apache and others.
- Logger - logs IRC events to a DB. Has a web UI.
- Reservation - for reservation of resources over IRC. Has a web UI.
- WhereIs - looks for nicks in all channels, supports wildcards.
- Messenger - delivers messages to users which are offline when they connect ("answering machine").
- PasteBin - let's user paste text through PM, saves it, and posts a link to a web UI to the channel.
- AutoOp - gives op to users.
- Social - reacts to "Hi!" etc. Kind of Hello World plugin.
If you're not into that, you may try PircBotX which tries to fix PircBot's wrong design.
List of other options is also here: Building an IRC bot in Java
精彩评论