This project has a Docker Container. You don't need to be a coder to get a copy running. Follow these instructions
- Docker Desktop installed on your local machine.
- Optionally install Git on your local machine.
-
Download the source code and unzip
or Clone this repository to your local machine using http.
git clone https://github.com/helmetwearer/djangotwitchchatbot.git
-
Navigate to the project directory.
cd /path/to/source/djangotwitchchatbot
-
Run the following command to start the application:
docker-compose up
-
Once the containers are running, open your web browser and navigate to http://127.0.0.1:8000/admin.
-
Log in with the following credentials:
- Username:
django
- Password:
ChangeThisPassword
- Username:
-
Visit http://127.0.0.1:8000/admin/quotationbot/chatserversettings/1/change/.
-
Change the field "Twitch handle" to your Twitch username.
-
Go to https://antiscuff.com/oauth/ and hit the connect link. Then paste the result in the field named "Twitch oauth token".
-
Hit save.
-
Click on "Add Quotation" in the top right corner.
-
Leave the "Bucket name" field empty unless you want to set advanced coding configurations.
-
Enter the text of your quotation in the "Text" field.
-
Check "Approved" for the message to be available as a random message to the bot.
-
Click on "Save".
-
Click on "Add Channel" in the top right corner.
-
Put the full streamer name in the "Name" field.
-
Check "Bots Enabled" for the channel to receive messages from the bot.
-
Optionally set a minimum and maximum minute frequency of messages in the appropriate fields.
-
Click on "Save".
You must be running on OSX. You need this app: Simple Imessage Server
download it, and double click the app, when it asks for permissions say yes. That's it. The rest you can configure in this bot.
To add an Imessage channel:
Name should be the phonenumber i.e. 1231231234
Check the "Is imessage server" checkbox
Check the "Bots enabled" checkbox as well.
Do yourself a favor and don't make it go faster than 5 minutes. A chain message feature is in the works that will allow burst behavior.
If you want emotes copy/paste them out of the message app into the quotes.
Working on getting this in a docker
A note about streamer follower settings and how IRC interaction is implemented. You will have to log into twitch, follow some channels, and actually interact with the web GUI (or perhaps mobile chat would suffice haven't tested). I'm not fixing that, and that's not a lack of technology decision it's an intentional barrier. I highly recommend you use a verified account with your mobile number and have 2FA on.
This app needs documentation still. Initial code checkin, will add later.
Install the reqs probably should set up a virtualenv etc:
pip install -r requirements.txt
Create a superuser:
./manage.py createsuperuser
Run the web server:
./manage.py runserver
For a production webserver this is a great guide:
and you should probably include supervisord with that:
Go to the admin and login:
For each channel you want the bot to monitor, create a channel object
name should be the exact handle of the twitch channel you want to run the bot in
you must check "bots enabled" to actively scan the channel. Useful for quick and immediate takedown without having to delete.
the bot will send a message at a random interval between the minimum and maximum minutes set. however if you set the minimum less than the setting QUOTATION_TIME_INTERVAL don't expect it to work. If you don't know how to change the setting, it's probably best you can't go lower
For each Quotation you will have to specify a bucketname. This allows us to put quotes into different chat buckets, and run several different types of quotes at once. The setting BOT_DEFAULT_BUCKETS is helpful here.
In order for the quote to be in the random pool the approved flag must be checked. This allows for quick takedown of any poorly sourced quotes that may have entred the system.
To start the chatbot:
./manage.py quotationbot --verbose --ignore
or
./manage.py quotationbot bucketname1 bucketname2 bucketname3 --verbose --ignore
If no bucket names are passed it will use the setting BOT_DEFAULT_BUCKETS
For bot specific configurables check the settings
Some of the configurables like twitch tokens can be set in the app here
Highly encouraged to use a local_settings.py file for stuff like:
TWITCH_HANDLE = 'your_twitch_user_name'
TWITCH_OAUTH_TOKEN = 'go here to get an oauth token: https://antiscuff.com/oauth/'