Sign inSign up

blolol/wheaties-brain-java

By blolol

•Updated over 4 years ago

Simple MegaHal IRC bot

Image
0

453

blolol/wheaties-brain-java repository overview

⁠wheaties-brain-java

wheaties-brain-java combines PircBotX⁠ and JMegaHal⁠ into a simple conversational IRC bot.

The bot will respond when someone mentions its nick, and "learns" from all others. It attempts to identify "interesting" words in order to generate a relevant response, skipping common English words like articles and prepositions.

wheaties-brain-java ignores messages that begin with any of the characters in IGNORE_PREFIXES (useful if you have other IRC bots whose interface involves a command prefix). It also ignores messages in the form "nick: x is y" to avoid conflicts with the Wheaties programmable chat bot⁠.

If you're running Matterbridge⁠, you might have an IRC bot in your channel that sends messages of the form "[source] <nick> message" or "<nick> message". wheaties-brain-java recognizes those, and only learns from the chat message itself.

⁠Usage

The easiest way to run wheaties-brain-java is using the wheaties-brain-java⁠ Docker image:

docker run -e IRC_NICK=Wheaties -e IRC_SERVER=irc.example.com wheaties-brain-java:latest

wheaties-brain-java can be configured using the following environment variables.

NameRequired?Description
IGNORE_PREFIXESOptionalIgnore messages starting with any character in this environment variable's value.
IRC_CHANNELSRequiredComma-separated list of IRC channels to join.
IRC_NICKRequiredIRC nickname.
IRC_PASSOptionalIRC server password.
IRC_PORTRequiredIRC server port.
IRC_REALNAMERequiredIRC real name.
IRC_SERVERRequiredIRC server address.
IRC_TLSOptionalSet to true to connect using TLS.
IRC_USERRequiredIRC server username.
MATTERBRIDGE_USEROptionalMatterbridge⁠ bot username. If this environment variable is set, wheaties-brain-java will strip any [source] <nick> prefix from the message before "learning" it.

⁠Building

To build the project, run ./gradlew build. To build a standalone "fat" JAR that includes all dependencies, use ./gradlew shadowJar. To build a Docker image tagged with the project's current version, run ./gradlew docker.

⁠License

In order to be compatible with PircBotX⁠, wheaties-brain-java is licensed under the GNU General Public License v3.

Tag summary

Content type

Image

Digest

Size

234.8 MB

Last updated

over 4 years ago

docker pull blolol/wheaties-brain-java