Since livecoding.tv is no longer exist, bot is deprecated
deadbot is extension-based multiservice (with Livecoding.tv support) chat bot.
- Python 3
- Python libraries:
- lxml
- validators
- requests
- websocket-client
- Your own or separate bot's account on streaming platform
- Command line
$ sudo pip install -r requirements.txt
Note: prefer your system's package manager over the pip Note (2): not all packages may be in system's repository
$ cp config.json ~/.deadbot.json
$ vim ~/.deadbot.json
Note: use your favorite editor
$ ./deadbot
or
$ python deadbot.py
also you can specify config file directly:
$ ./deadbot myconfig.json
Note: also you can use external tool with GUI, but now it's not ready
All configurable settings stored in your config file (~/.deadbot.json by default).
This file has separate manager, engine and extensions sections.
Here is global settings that uses to configure whole application:
command-prefix
-- prefix walking in front of each command, as example with prefix!
help command will looks like!help
message-format
-- how will looks text sended by bot, as example withI say: {text}
, then bot sayshi
, it will be displayed likeI say: hi
greeting
-- message, which bot will send when he will be connected, can be removedparting
-- message, which bot will send before he will be disconnected, can be removed
Engine section contains information about using service, channel and authorization data.
Currently Deadbot supports only Livecoding.tv, but I'll add twitch.tv support soon.
service
-- service which bot will usechannel
-- your channel namebot-name
-- name of bot's account on specified servicebot-key
-- bot's account's key (see Getting Livecoding.tv key to get more info)bot-color
-- color of bot in chat. Supported colors is:#e35b5b
#e3a85b
#d1e35b
#8ee35b
#5be3a8
#5bbbe3
#5b74e3
#915be3
#e35bde
bot-key-file
-- alternative tobot-key
if you want to use external file with keyignore-own-messages
-- by default bot will not react on own messages, but this can be disabled, because it's usefull, especialy if you use our own account for bot
Note: Livecoding.tv key is secret, never share it with outsiders.
To get livecoding.tv key:
- Open any livecoding.tv channel with chat
- Open developer tools and start recording network events
- Find WebSockets event
- Open WebSockets frames
- Find frame (it must be 4-rd) with similar content:
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>HERE IS YOUR KEY</auth>
Here is a bunch of included extensions with it's own configuration:
Spammer is extension which sends random messages in random interval with configured send chance.
phrases
-- list of phrases which bot will say sometimeschance
-- number (from 0 to 1) sets, how often bot will spam (as example 1/60 is aprox 1 message in minute)
Greeter is extension which sends message then viewer joins chat.
greetings
-- list of phrases to say. You can use following patterns in phrases:{user}
-- name of user which joined
Commands is extension that allow to add simple text commands.
Format is "command-name": {COMMAND OPTIONS}
.
Commands options is:
answer
-- how to answer on command. You can use following patterns:{user}
-- user which send command{args
-- arguments passed with command, as example for!say something intresing
arguments is"something intresing"
description
-- how to display command in helpargs
-- how to display arguments in help
hi
- says"Hi, username"
say WHAT
- says anythingversion
- just says 0.1
Player control is extension that allow to listen music from deadbot (via external player) and control music througth chat.
-
player
-- name of external player to use, now only mpv supported -
scraper
-- name of service which will be used to take music from, now only youtube supported -
playing-format
-- phrase which bot will say then it will play new song. You can use following patterns:{title}
-- title of song{url}
-- url from which the music is played
-
adding-format
-- phrase which bot will say then some user will add song to playlist. You can use following patterns:{song}
-- song name
-
failure-format
-- phrase which bot will say then he can't play song. You can use following patterns:{song}
-- song name
-
fallback-playlist
-- list of songs which will be used with empty user-driven playlist
play SONG
-- adds song to playlistsong
-- shows current songplaylist
-- shows current user-driven and fallback playlists