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
git clone ...
cd wprotbot
pip install -r requirements.txt
cp ./.env.example ./.env
Set enviroment variables:
ACCESS_TOKEN
(required) You can get access token usingoauth.htm
file: open the file and click theGet token
link. Accept the permissions, and after the redirect to localhost copyaccess_token
from the urlCHANNEL
(required) Bot must be a moderator on this channelREWARD_ID
(required) The ID of the reward that the user must purchase to get a titleDB_NAME
(optional, defaultwprotbot.db
) If the file doesn't exist, it will be created during the first runTITLE_COOLDOWN_SEC
(optional, default 6 hours) If the user hasn't written in the chat for a long time, then announce them after their messageTITLE_LIFETIME_SEC
(optional, default 2 weeks) A title is purchased for this periodGREETING_TEMPLATE
(optional, default{title} @{username}
) Announcement templateIS_AI_ENABLED
(optional, defaultFalse
) If enabled, the bot will react to the purchased title using OpenAI.OPENAI_API_KEY
(required ifIS_AI_ENABLED
) OpenAI API KeyREACT_TITLE_PROMPT
(optional) Prompt for the bot reactionAD_IN_GAME_PROMPT
(optional) Prompt for advertising the purchase of a title during the gameAD_IN_GAME_QUERY
(optional) Query for advertising the purchase of a title during the gameAD_NO_GAME_PROMPT
(optional) Prompt for advertising the purchase of a title outside of the gameAD_NO_GAME_QUERY
(optional) Query for advertising the purchase of a title outside of the gameAD_TEMPLATE
(optional) Title purchase advertising template
Run bot:
python main.py
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