A Twitch chat bot designed to automatically join Tangia Dungeons and Boss Fights, with additional features for streamers and moderators.
- Auto-Join: Automatically joins Tangia Dungeons and Boss Fights when detected in chat.
- Channel-Specific Control: Supports multiple channels with independent configurations.
- Pause Functionality: Allows authorized users to pause the bot for a specified duration.
- Customizable Permissions: Define which users can control the bot on each channel.
- Customizable Messages: Customize the bot's messages for different events, commands, and responses to fit the needs of each community.
- Custom Commands: Allow the creation of custom commands tailored to the channel’s needs
- Token Refresh: Automatically refreshes Twitch OAuth tokens when expired.
- Logging: Detailed logging with timestamps and color-coded messages.
- Node.js (v18 or higher)
- npm (included with Node.js)
- Docker (optional, for containerized deployment)
-
Clone the repository:
git clone https://github.com/Cacus3/tangia-bot.git cd tangia-bot -
Install dependencies:
npm install
-
Create a
.envfile based on.env.exampleand fill in the required values:cp .env.example .env
-
Start the bot:
npm start
-
Build the Docker image:
docker-compose build
-
Start the container:
docker-compose up -d
-
View logs:
docker-compose logs -f
| Variable | Description |
|---|---|
TWITCH_CLIENT_ID |
Your Twitch application client ID. |
TWITCH_CLIENT_SECRET |
Your Twitch application client secret. |
BOT_USERNAME |
The username of your Twitch bot account. |
CHANNELS |
Comma-separated list of channels to join (e.g., "channel1,channel2"). |
INITIAL_ACCESS_TOKEN |
Initial OAuth access token for the bot. |
INITIAL_REFRESH_TOKEN |
Initial OAuth refresh token for the bot. |
ALLOWED_USERS |
JSON object mapping channels to allowed users for moderate bot (e.g., {"channel1":["user1"]}). |
STOP_DURATIONS |
JSON object mapping channels to stop durations in minutes (e.g., {"channel1":30}). |
RESPONSE_DELAY_MIN |
Minimum delay in milliseconds between each response. |
RESPONSE_DELAY_MAX |
Maximum delay in milliseconds between each response. |
PAUSE_COMMANDS |
JSON object mapping channels to pause commands (e.g., {"channel1":["!pausebot", "!stoptangiabot"]}). |
ENABLE_PAUSE_MESSAGES |
Set to true to enable showing pause messages when bot is paused. |
ENABLE_MISSING_PERMISSION_MESSAGES |
Set to true to enable showing missing permission messages. |
ENABLE_RESUME_MESSAGES |
Set to true to enable showing resume messages when the bot is resumed. |
PAUSE_MESSAGE |
Message to display when bot is paused, uses placeholders {username}, {duration}, and {channel}. |
RESUME_MESSAGE |
Message to display when bot is resumed, uses placeholders {username} and {channel}. |
MISSING_PERMISSION_MESSAGE |
Message to display when a user lacks permission, uses placeholder {username}. |
- Auto-Join: The bot automatically joins Dungeons and Boss Fights when detected in chat.
- !stopTangiaBot: Pauses the bot for a specified duration (only for authorized users).
-
Auto-Join:
- When
tangiabotposts:Player123 started a Tangia Dungeon! Use !join to join the party. - The bot responds with:
!join
- When
-
Pause Bot:
- An authorized user types:
!stoptangiabot - The bot responds:
⏸️ Bot paused for {duration} minutes! - After the duration, the bot resumes:
▶️ Bot active!
- An authorized user types:
tangia-bot/
├── src/
│ ├── config/ # Configuration files
│ ├── services/ # Core bot functionality
│ ├── utils/ # Utility functions (e.g., logging)
│ └── index.js # Main entry point
├── .env.example # Example environment variables
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Dockerfile for containerization
├── package.json # Node.js dependencies and scripts
└── README.md # This file
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MPL 2.0 License.
For issues or questions, please open an issue on the GitHub repository.
Happy streaming! 🎮