Skip to content
This repository was archived by the owner on Nov 6, 2021. It is now read-only.

Config.json

sharedferret edited this page Apr 22, 2012 · 2 revisions

config.json is written in JSON, a file format that's easily readable by JavaScript files. When editing this file, remember that every quotation mark, comma, and curly brace are important to keeping the file readable, so don't remove them.

Remember to rename your config file to config.json before running your bot!

##Layout

botinfo
	auth: Your bot's auth code.
	userid: Your bot's user id.
	botname: Your bot's short name (for commands like [name], pm me)
roomid: The room you want your bot to be placed in.
admin: Your user id.
database
	usedb: Set to true if you want to use a database, false otherwise.
	logchat: Set to true if you want to log chat, false otherwise.
	dbname: The name of your mysql database.
	tablenames
		song: The name of your song table.
		chat: The name of your chatlog table (name this even if you have logchat set to false)
		user: The name of your userlist table.
		holiday: The name of your holiday greeting table
	login
		user: Your bot's mysql login
		password: Your bot's mysql login password
lastfm
	useapi: Set to true to use the last.fm service, false otherwise.
	lastfmkey: Your last.fm api key. (Obtain an API key at http://www.last.fm/api/ or disable under Flags)
http
	usehttp: Set to true to enable HTTP connections, false otherwise.
	port: The port you want to listen on.
	host: The host you want to listen on (Use your computer's internal IP
		if you want to listen to external connections, localhost otherwise)
tcp
	usetcp: Set to true to enable TCP connections, false otherwise.
	port: The port you want to listen on.
	host: The host you want to listen on (Use your computer's internal IP
		if you want to listen to external connections, localhost otherwise)
responses
	respond: Set to true to have the bot respond to chat commands in chat, false otherwise
	reportsongstats: Set true to report song stats in chat after each song
	welcomeusers: Set true to welcome users as they join
	`welcomepm`: Sends users a PM on join.
	`alwayspm`: Set true to PM the `pmgreet` message to users every time they join. Set false to only send a PM if the user hasn't been seen in at least 36 hours.
	`pmgreet`: The PM greeting sent if `welcomepm` is enabled.
	greeting: The greeting to display to joining users
	ownerresponse: The response to ".owner"
	sing: Have the bot sing portions of certain songs (add them in singalong.js)
	rules
		description: A description of your room's rules
		link: A link to your room's rules
consolelog: Have the bot log events in the console
bonusvote: The bot can awesome songs in one of five modes: NONE, VOTE, CHAT, DICE, AUTO.
enforcement
	enforceroom: Set to true to have the bot enforce room rules
	waitlist: Set to true to have the bot enforce a waitlist/queue
	songstoplay: How many songs a user can play before they must step down
	stepuprules
		waittostepup: Toggles this section on/off
		waittype: MINUTES or SONGS
		length: How many minutes/songs a user must wait before stepping up again
	ffarules
		multiplespotffa: Make all spots free-for-all if there are 2+ DJ spots open
		timerffa: Make a spot free-for-all after a certain period of time
		timeout: The timer for timerffa in seconds
maintenance
	autorejoin: Have the bot rejoin if booted

Instructions for filling out config.json

####Basic Info The first thing you'll need for this is an account for your TT.fm bot. Create an account for your bot, then have it join your Turntable room through a web browser. Next, use this bookmarklet to get the auth, userid, and roomid values for the config file. Also, add a short nickname for your bot under botname.

####Database If you're not planning on using a database with your bot, set database.usedb to FALSE and skip ahead to the last.fm section. Otherwise, set it to TRUE. Provide the database name you'd like the bot to use next to dbname. If you'd like the bot to log chat message, set logchat to TRUE. Next, provide the table names you'd like the bot to use (it is not necessary to create these yourself, except for the holiday table, which we'll do in a second). Finally, supply a MySQL username and password for the bot to use.

The next step is to import the provided SQL tables to the database you're using. These SQL files are located in the SQL Commands/ folder. They can be imported using the command

mysql -u myuser -p databasename < [Filename].sql

or by importing them with an application like phpMyAdmin.

####Last.fm The bot can use the Last.FM API to retrieve similar song and artist data for the current song. This requires an API key from last.fm's website. If you'd like to use the service, set useapi to TRUE and provide the key from last.fm next to lastfmkey.

####TCP TCP functionality is being phased out in favor of the bot's HTTP-based API. Set usetcp to FALSE unless you really want to use raw TCP.

####HTTP The bot has a built-in API that can respond to a variety of commands over HTTP. To enable this functionality, set usehttp to TRUE, select a port to use, and set host to your computer/server's internal IP address.

####Responses This section determines how your bot reacts in chat. Enabling respond will allow your bot to respond to commands in chat. reportsongstats allows your bot to report the awesomes, lames, and snags after every song.

welcomeusers allows your bot to welcome users in chat.

welcomepm sends users a PM if they haven't been seen in at least 36 hours.

greeting is the welcome message used if welcomeusers is enabled.

sing will allow the bot to sing along to certain songs (using the singalong.js file)

rules are a short description of rules for your room.

consolelog will log all events in the console. Don't enable this if you're running the bot for an extended period of time.

bonusvote determines when the bot will awesome a song. This can be set to NONE, VOTE, CHAT, or DICE.

####Enforcement To have the bot enforce room rules, set enforceroom to TRUE.

waitlist will create a waitlist/queue in your room.

songstoplay indicates how many songs a user can play before they must step down.

stepuprules determine if a user needs to wait to step up after playing music. The waittype can be in either SONGS or MINUTES.

ffarules determine when spots are FFA (free-for-all). multiplespotffa will allow anyone to step up if 2 or more DJ spots are open, while timerffa will let anyone step up if a certain amount of time has passed.

####Maintenance autorejoin lets the bot automatically rejoin a room if it has been booted from that room.

Clone this wiki locally