Twitch Bot Project (Rust)
Overview
This is a Twitch bot written in Rust that connects to the Twitch IRC server and allows users to interact with the bot via chat messages. The bot can join multiple Twitch channels and respond to commands.
Features
- Connects to the Twitch IRC server using an OAuth token for authentication.
- Allows the bot to join multiple Twitch channels specified in the configuration file.
- Listens to chat messages from the channels and responds to specific commands.
- Sends messages to the chat in response to user input.
- Gracefully handles CTRL+C signal to terminate the bot.
Getting Started
Prerequisites
- Rust programming language is installed on your system.
Installation
- Clone the repository to your local machine.
git clone https://github.com/icsboyx/rustbotx.git
- Change into the project directory.
cd rustbotx
Configuration
Before running the bot, make sure to create a config.json
file in the project directory with the following content:
"server":"irc.server.addr",
"port": 6667,
"ssl_tls": true,
"ssl_verify_mode" : true,
"token": "YOUR_TWITCH_OAUTH_TOKEN",
"nickname": "YOUR_BOT_NICKNAME",
"channels": ["channel1", "channel2", "channel3", "channel_N"]
- "ssl_tls": true, for ssl/tls
- "ssl_tls": false for tcp clear
Replace YOUR_TWITCH_OAUTH_TOKEN with your Twitch OAuth token, and YOUR_BOT_NICKNAME with your desired bot nickname. Add the Twitch channels you want the bot to join in the "channels" array.
Usage
- Build and run the bot.
cargo run
- The bot will connect to the Twitch IRC server and join the specified channels.
- It will start listening to chat messages and respond to commands from viewers.
- To send a message to the chat, type your message in the console and press Enter.
Tags
- v1.0.0: Initial release of the Twitch bot.
- beta: Beta version of the bot with additional features.
Contribution
Contributions are welcome! If you find a bug or want to add new features, feel free to create a pull request.
Special Thanks
This project was inspired by the Twitch channel of Prof. Andrea Pollini and the supportive Twitch community. Thanks to their encouragement and feedback!
License
This project is licensed under the MIT License - see the LICENSE for details.