The New Beastie is here!
Has:
- Tmi client for Twitch (library to be replaced)
- Webhooks server subscribed and listening to Twitch (library to be replaced, DIFFICULT)
- Twitter client (library to be replaced)
- Database connection for storing community currency (AWS DynamoDB)
- Yup for environment variable validation.
- Prettier for code automagic code formatting.
Setting up the development environment:
- bot acc = account you want the bot to use when chatting
- broadcast acc = account you use when you stream
- Copy .env.example to .env
- Create a twitch account for your bot, if you do not want it to use your broadcaster acc.
- Go to https://dev.twitch.tv/console/apps and create a new application.
- Set Name to whatever you want to call your bot, OAuth redirect to
http://localhost
and category to "Chat bot". - Copy your Client ID and Client Secret into the corresponding fields in the .env
- Go to https://twitchapps.com/tmi and generate an oauth for your bot acc.
- Set the username and oauth of the bot acc in
BEASTIE_USERNAME
andBEASTIE_OAUTH
without theoauth:
respectively. - Replace
<YourClientId>
with your Client Id and follow the link in your browser to create a token for your broadcasting acchttps://id.twitch.tv/oauth2/authorize?client_id=<YourClientId>&redirect_uri=http://localhost&response_type=token&scope=chat:read+chat:edit+channel:moderate+whispers:read+whispers:edit+channel_editor
- Copy the token from the redirect url after you have authorized and paste into
BROADCASTER_OAUTH
along with your username in theBROADCASTER_USERNAME
field. - Go to https://discord.com/developers/applications and create a new application
- Go to Bot and click "Add Bot" and copy the token into the
DISCORD_TOKEN
field. - Go to OAuth2 and set redirect url to
http://localhost
and scope tobot
. - Set the permissions as needed (admin is most practical for dev). Copy the URL under
scopes
and add the bot to your server - Go to General Information and grab the client id and secret and add them to your .env
- Set
DISCORD_GUILD_NAME
to the name of the server you want the bot to run in. - Set
DISCORD_WELCOME_CHANNEL
to name of the channel you want the bot to welcome people in - Set
DISCORD_FEED_CHANNEL
to the channel you want to use for having the bot post messages to twitter - Set
DISCORD_GUILD_MASTER_ID
to your discord Id - Run yarn install in the root folder, if you do not have yarn installed you can run npm install followed by yarn install 0 You are set up and ready to start developing!
Setting up dynamoDB to run locally:
- Follow the guide for installation here - https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html
Usage:
./run.sh
run script that automates dockerization for the app
Future:
-
Clean project of base template packages/scripts/files
-
Refactor project structure by feature
-
Enable Twitter client to post when broadcaster stream state changes to 'live'
-
Add !livestream/!uptime command to display stream data
-
Edit Discord interval to link to discord server
-
Add Discord client to post when broadcaster stream state change to 'live'
-
Add create database script for developers
-
Restart Beastie automatically on shut down
-
Add Raid System/Features
-
Create markdown file with full feature list