This is a Python chat bot that monitors specified Twitch channels for a given search phrase and relays the chat message to a Discord channel.
- Discord markdown escaping to prevent text formatting errors.
- Non-Twitch link removal.
-
Download Bot-Main.py
-
Install the Discord Python module.
pip install discord
- Set up Twitch and Discord API credentials:
- Create a Twitch account and register a new application to obtain your Twitch API credentials:
https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#oauth-client-id-and-secret - Create a Discord account and a new application to obtain your Discord API credentials:
https://discord.com/developers/applications
-
Set the following variables:
- TWITCH_TOKEN: Your Twitch API token.
- TWITCH_USERNAME: Your Twitch username.
- DISCORD_TOKEN: Your Discord API token.
-
Modify the following variables according to your preferences:
- SEARCH_PHRASE: The phrase to search for in Twitch chat.
- TWITCH_CHANNELS: A list of Twitch channels to monitor.
- DISCORD_CHANNEL: The Discord channel to post the messages in.
-
Run the bot.
Twitch is a trademark or registered trademark of Twitch Interactive, Inc. in the U.S. and/or other countries. "TwitchIRC-Discord-Bot" is not operated by, sponsored by, or affiliated with Twitch Interactive, Inc. in any way.