Wrapper for pre-rolled bot templates for Twitch
Project description
twitch_bot
Section 1: Initial Setup
This is to set up all of the codes the bot needs.
- Download python: https://www.python.org/downloads/release/python-31011/
- Clone/Download this code
- Hit "Windows key" + "Q" -> "Command Prompt"
- Change directory to where you downloaded the code
- Type the following into the "Command Prompt" window:
pip install -r requirements.txt
Section 2: Setting up Twitch Settings
We need to make an "application" for the bot to act as, and you'll allowing the bot to act on your behalf.
- Go to: https://dev.twitch.tv/console
- Click on "Register your Application"
- Create a name. Note this down
- OAuth Redirect URL: type
http://localhost:3000. If it won't let you, set it tohttp://localhost. - Category: Chat Bot
- Client Type: Confidential
- Create
- In the next screen, click on "Manage" in the new row that's been created
- If step 4 didn't work, change the OAuth Redirect URL now.
- Copy the "Client ID". Copy this somewhere.
- Click on the "New Secret" button. Copy this somewhere AND DO NOT SHARE IT.
Section 3: Configure the chatbot
We are going to populate the information the bot needs to talk Twitch now in the env.cfg file.
- Line 2 - WIN_CRED_KEY: After the "=" you put anything you want (no spaces). This is what name we'll store all the sensitive information in the Windows Credential Store.
- Line 3 - CLIENT_ID: After the "=", copy in the Client ID from step 9 in the last section.
- Line 5 - BOT_NICK: The username of the account the bot will act as
- Line 6 - CHANNELS: All of the channels you want this bot to participate in. Put each channel in a new line.
- Hit "Ctrl + Windows key" -> "Credential Manager"
- Hit the "Windows Credentials" tile
- Under "Generic Credentials" hit "Add a generic credential"
- Internet or network address, enter what you put in step 1 (everything after the "=" with no spaces)
- User name: The "Client ID" you wrote down
- Password: The "New Secret" you wrote down
Section 4: Start the chatbot
- Hit "Windows+ "Q" key -> "Command Prompt"
- Change directory to where you downloaded the code
- Type the following into the "Command Prompt" window:
python -m mountaineer_bot.bots.mod_bot -c env.cfg - An authorization page might come up. Check the permissions needed and authorize if ok.
- You should see "Running in channels: {channels you listed}", then "Starting bot..." and then "{your username} is online!". If you see these, congrats, the bot is ready to go! Otherwise, you might've gone down the Section 4 path.
- When you're finished, close the window you created in this section.
Commands
- !where: The bot will respond with "I'm here".
- !hello: The bot will say hi to whoever typed it
- !cd {duration in seconds}: Will start a countdown. If someone else types it then it will replace any existing countdowns
- !cd cancel: Will cancel a running countdown
Acknowledgement
I wrote this code from scratch. While I'll happy to share this code, please acknowledge my contribution by linking to twitch.tv/three_mountaineers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mountaineer_bot-0.0.1.dev2024122801-py2.py3-none-any.whl.
File metadata
- Download URL: mountaineer_bot-0.0.1.dev2024122801-py2.py3-none-any.whl
- Upload date:
- Size: 54.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed4d612c906eacf45193c16745a55cc4bfc09f6b5a5a6131e99f695f56689562
|
|
| MD5 |
f39574c236b4f3bb0c279edfa3244f63
|
|
| BLAKE2b-256 |
9049d831c739d1edbfc39acac374b1effa8bd70ee19826095305baa04e493de0
|