This repository contains a Discord bot designed to automate the process of collecting and forwarding streaming links from multiple platforms (e.g., Twitch, YouTube, Kick, Facebook) to a designated channel in a formatted manner. The bot extracts links, retrieves stream titles (where applicable), and allows easy extensibility for adding or removing platforms.
The primary purpose of this bot is to:
- Collect stream links from various platforms as they are posted in a specific Discord channel.
- Combine these links into a single, formatted message.
- Forward the formatted message to another designated channel for easy sharing.
- Support for popular streaming platforms: Twitch, YouTube, Kick, and Facebook.
- Automated title fetching for YouTube and Kick streams.
- Easily configurable platform URLs and user-specific data.
- Extensible design to add or remove supported platforms.
To run this bot, you need:
- 
Python 3.8+ 
- 
The following Python libraries: - discord.py
- beautifulsoup4
 Install them using: pip install discordpip install beautifulsoup4
- 
A Discord bot token 
- 
A YouTube Data API v3 key 
- Go to the Discord Developer Portal.
- Create a new application or select an existing one.
- Navigate to the Bot tab and click "Add Bot."
- Copy the token and paste it into the BOT_TOKENfield in themain.pyfile.
- Give necessary permissions for the bot
- Visit the Google Cloud Console.
- Create a new project or select an existing one.
- Enable the YouTube Data API v3 for your project.
- Generate an API key and paste it into the get_youtube_titlefunction in themain.pyfile.
- Open Discord and enable Developer Mode from Settings > Advanced.
- Right-click on the desired source channel and select "Copy ID." Paste it into the SOURCE_CHANNEL_IDfield in themain.pyfile.
- Do the same for the target channel and paste it into the TARGET_CHANNEL_IDfield.
Replace the placeholder usernames in link_storage with your own:
- For Twitch: https://www.twitch.tv/your_user_name
- For Kick: https://kick.com/your_user_name
- For Facebook: https://web.facebook.com/your_user_name
- Save the file as main.py.
- Run the bot using:
python main.py 
- Ensure the bot is online and monitoring the source channel.
- Create a .batfile (e.g.,linkbot.bat) with the following content:@echo off python "path_to_main.py" pause 
- Replace path_to_main.pywith the full path to yourmain.pyfile.
- Double-click the .batfile to run the bot like an application.
- Add a new key to the link_storagedictionary with the platform name and its default link.
- Update the identify_platformfunction to detect messages for the new platform based on keywords or bot names.
- Optionally, implement a title-fetching function similar to get_kick_titleorget_youtube_title.
- Delete the platform's key from the link_storagedictionary.
- Remove any references to the platform in the identify_platformfunction.
- Update the forward_combined_linksfunction to exclude the platform from the final message.
- Ensure that the bot has permission to read and send messages in the specified channels.
- Use a secure method to store sensitive information like the bot token and API keys (e.g., environment variables).
- Debug any issues by reviewing the bot's console output for error messages.
This project is licensed under the MIT License. Feel free to modify and distribute it as needed.
For questions or contributions, feel free to open an issue or submit a pull request!