Skip to content

The Twitch Discord Bot combines Twitch and Discord features. It reads Twitch messages aloud in a Discord voice channel. Use !join and !leave commands for Discord control. Enjoy real-time speech synthesis for an interactive experience.

License

andrxd/TwitchToDiscordVoiceBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TwitchToDiscordVoiceBot

Twitch Discord Bot

This project is a Twitch and Discord bot that connects to a Twitch channel, listens to messages, converts them to speech using Google Text-to-Speech (gTTS), and plays the generated audio in a Discord voice channel. The bot supports basic commands to join and leave voice channels in Discord.

Prerequisites

Before you start, ensure you have the following installed on your machine:

  • Python 3.8 or higher
  • pip (Python package installer)

Installation

  1. Clone the repository:

    git clone https://github.com/andrxd/TwitchToDiscordVoiceBot.git
  2. Navigate to the project directory:

    cd TwitchToDiscordVoiceBot
  3. Install the required dependencies:

    pip install -r requirements.txt

Configuration

  1. Create a .env file in the project directory:

    TWITCH_TOKEN=your_twitch_token
    DISCORD_TOKEN=your_discord_token
    CHANNEL_NAME=your_twitch_channel_name
    VOICE_LANGUAGE=pt-br

    Replace your_twitch_token, your_discord_token, your_twitch_channel_name, and pt-br with your actual Twitch and Discord bot tokens, your desired Twitch channel name, and the language code for the voice language.

    You can customize the VOICE_LANGUAGE variable with the language code corresponding to the desired language for the Google Text-to-Speech output. For a list of supported language codes, you can refer to the gTTS documentation

Usage

  1. Run the bot:

    python twitch_discord_bot.py

    The bot will connect to both Twitch and Discord.

  2. In Discord, use the following commands:

    • !join: Bot joins the voice channel of the user who issued the command.
    • !leave: Bot leaves the voice channel.

Notes

  • Ensure that the bot has the necessary permissions to join and leave voice channels in Discord.
  • Make sure that your Discord bot is added to the server where you want it to operate.
  • The bot will automatically play the speech audio when a message is sent in the connected Twitch channel.

Dependencies

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

The Twitch Discord Bot combines Twitch and Discord features. It reads Twitch messages aloud in a Discord voice channel. Use !join and !leave commands for Discord control. Enjoy real-time speech synthesis for an interactive experience.

Topics

Resources

License

Stars

Watchers

Forks

Languages