OakBot is a chat bot for Stack Overflow Chat that's written in Java. It is named after the first name given to the Java programming language before it became "Java".
OakBot is most active in the Java chat room.
- Java 1.8
- Maven (for building)
To build the project, run the command below.
This command will build the project and package it into an executable, shaded JAR. A shaded JAR file contains all of the project's dependencies. The shaded JAR file is saved here:
- Copy the following files to the server. Put them in the same directory:
target/OakBot-VERSION.jar: The executable, shaded JAR file that contains OakBot's code and dependencies.
bot.properties: This file contains configuration data, such as the bot's login credentials. A sample file is located in the root of this project.
logging.properties(optional): The configuration file for the Java Logging API. A sample file is located in the root of this project.
- Run OakBot:
java -jar OakBot-VERSION.jar
- Once the bot has fully started up, it will instruct you to press
Ctrl+Z, then type the
bgcommand. In Linux, this will move the program into the background and free up the shell.
This is the file OakBot uses to persist information, such as how many commands it has responded to and what rooms it has joined. It is located in the bot's working directory. The file will automatically be created if it doesn't exist.
Contains various configuration settings for the bot. Open the sample "bot.properties" file at the root of this project for a description of each setting.
OakBot must be restarted if any of these settings are changed while OakBot is running.
All of OakBot's commands are listed on the wiki.
|--settings=PATH||The properties file that contains the bot's configuration settings, such as login credentials (defaults to "bot.properties").|
|--db=PATH||The path to a JSON file for storing all persistant data (defaults to "db.json").|
|--mock||Runs the bot using a mock chat connection for testing purposes.
A text file will be created in the root of the project for each chat room the bot is configured to connect to. These files are used to "send" messages to the mock chat rooms. To send a message, type your message into the text file and save it.
Messages are entered one per line. Multi-line messages can be entered by ending each line with a backslash until you reach the last line. You should only append onto the end of the file; do not delete anything. These files are re-created every time the program runs.
All messages that are sent to the mock chat room are displayed in stdout (this includes your messages and the bot's responses).
|--quiet||If specified, the bot will not output a greeting message when it starts up.|
|--version||Prints the version of this program.|
|--help||Prints descriptions of each argument.|
One way to reach me is in Stack Overflow's Java chat room. Please mention my name (@Michael) so I will see your message.
You can also submit bug reports and feature requests to the issue tracker.