Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boxfrommars/wprot-twitch-bot
Title bot for Twitch
https://github.com/boxfrommars/wprot-twitch-bot
bot chatbot openai twitch twitchio
Last synced: about 1 hour ago
JSON representation
Title bot for Twitch
- Host: GitHub
- URL: https://github.com/boxfrommars/wprot-twitch-bot
- Owner: boxfrommars
- Created: 2024-06-07T14:08:13.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-18T21:22:05.000Z (7 months ago)
- Last Synced: 2024-11-11T23:42:55.243Z (about 2 months ago)
- Topics: bot, chatbot, openai, twitch, twitchio
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Twitch Title Bot
Twitch Bot that allows users to purchase a title with channel points. When the user sends their first message in chat after a long time, the bot announces the user using the title. If the `IS_AI_ENABLED` setting is enabled, the bot will respond to the purchased title using OpenAI and will also advertise title purchases based on the current category of the stream
### Installation
```sh
git clone ...
cd wprotbot
pip install -r requirements.txt
cp ./.env.example ./.env
```Set enviroment variables:
* `ACCESS_TOKEN` *(required)* You can get access token using `oauth.htm` file: open the file and click the `Get token` link. Accept the permissions, and after the redirect to localhost copy `access_token` from the url
* `CHANNEL` *(required)* Bot must be a moderator on this channel
* `REWARD_ID` *(required)* The ID of the reward that the user must purchase to get a title
* `DB_NAME` *(optional, default `wprotbot.db`)* If the file doesn't exist, it will be created during the first run
* `TITLE_COOLDOWN_SEC` *(optional, default 6 hours)* If the user hasn't written in the chat for a long time, then announce them after their message
* `TITLE_LIFETIME_SEC` *(optional, default 2 weeks)* A title is purchased for this period
* `GREETING_TEMPLATE` *(optional, default `{title} @{username}`)* Announcement template
* `IS_AI_ENABLED` *(optional, default `False`)* If enabled, the bot will react to the purchased title using OpenAI.
* `OPENAI_API_KEY` *(required if `IS_AI_ENABLED`)* OpenAI API Key
* `REACT_TITLE_PROMPT` *(optional)* Prompt for the bot reaction
* `AD_IN_GAME_PROMPT` *(optional)* Prompt for advertising the purchase of a title during the game
* `AD_IN_GAME_QUERY` *(optional)* Query for advertising the purchase of a title during the game
* `AD_NO_GAME_PROMPT` *(optional)* Prompt for advertising the purchase of a title outside of the game
* `AD_NO_GAME_QUERY` *(optional)* Query for advertising the purchase of a title outside of the game
* `AD_TEMPLATE` *(optional)* Title purchase advertising templateRun bot:
```sh
python main.py
```### Usage
Purchase custom reward with `REWARD_ID` to get a title
Available commands:
* `!tit` or `!tit info` Get your title info
* `!tit delete` Delete your title
* `!tit info @wprotvbanke` *(moderators only)* Get information about the title of a given user
* `!tit delete @wprotvbanke` *(moderators only)* Delete this user's title