Table of Contents
a personal chat bot for my twitch channel, will make it usable on other channels at some point, im only a beginner coder but as i learn how to code better i will add more features to the bot, currently working on features that can be checked out in the Roadmap Section of this readme.
- Twurple
- Express.js
- guilded.js Basics, just for discord Embeds for webhooks
This is an example of how to list things you need to use the software and how to install them.
-
npm
npm install npm@latest -g
-
node
Node -
Code Editor[Optional Choices] NOTE: i do not know how to setup the project with Atom so everything is based on VS Code
VS Code
Atom
-
Create a Twitch Dev Application Twitch Developer Application, you will need access to a discord bot aswell, for webhooks
-
Clone the repo
git clone https://github.com/skullgaming31/OpenDevBot.git
-
Install NPM packages
npm install
-
Fill out the .env with all nessasary Information, check .env.example for whats needed
- Connected auth to account
- Connected ChatClient
- connected to PubSub(Dont Use Anymore)
- connected to EventSub with websockets
- add commands
- commands load from there own .ts file
- convert followage/accountage to years,months,day,hours,minutes,seconds
- convert uptime to display days,hours,minutes,seconds(24 hour streams)
- add word detection to send commands without prefix
- create channelPoints with userToken to modify the channel points with commands [Hard Coded ChannelPoints]
- Advanced Lurk Command
- Timer Commands
- Counters
- Quotes System?
- Viewer Watch Time?
- Virtual Currency System
- duel
- dig
- Heist
- Gamble
- Que/delay webhooks being sent to avoid being rate limited by the Discord API
- Added comprehensive unit tests covering:
authProvidertoken preloading and chat-provider registration fallbacks.- OAuth callback token exchange and persistence (
/api/v1/auth/twitch/callback). - Chat helper
getUsernamesFromDatabase()behavior for success and failure.
- Improved OAuth callback logging and normalization of returned scopes (code path exercised by tests).
- Implemented a dedicated chat auth provider and fallbacks to ensure the bot account is registered for the
chatintent (dev-only forced mapping remains as a temporary workaround). - Added debug logging around chat message parsing and command handling to aid diagnosis of why commands may not run.
- Started refactor to defer EventSub subscription registration until the websocket session is ready and added scaffolding for restart/retry logic (work in progress).
Notes: these changes include tests and mocks so the project can run unit tests without external Twitch or MongoDB services. See CHANGELOG.md for a detailed list of edits made on this date.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature) - Commit your Changes (
git commit -m 'describe your feature') - Push to the Branch (
git push origin feature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
Other Projects: Projects
- Twurple Twitch Library
Follow these steps to run OpenDevBot in production inside Docker. The compose file will start a MongoDB service and build the bot image from the repository.
- Copy the example env file and fill in secrets:
cp .env.prod.example .env.prod
# Edit .env.prod and fill in values (TWITCH_CLIENT_ID, etc.)2- Build and start the services:
docker compose up --build -d3- Logs:
docker compose logs -f opendevbotNotes:
- The compose file sets
MONGO_URItomongodb://mongo:27017/opendevbotfor the bot container. - Make sure to provide
TWITCH_CLIENT_ID,TWITCH_CLIENT_SECRET, and the bot OAuth token in.env.prod. - For a managed deployment, consider using secrets, a Docker registry for the built image, and external MongoDB.