bman46 / InstagramEmbedDiscordBot

Embeds videos and images from an Instagram link into a Discord chat.
BSD 3-Clause "New" or "Revised" License
75 stars 25 forks source link
bot discord-bot discordbot discordnet instagram instagram-bot instagram-scraper reels

Instagram Embed Discord Bot

CodeQL Publish

Delivers new posts from Instagram accounts to a Discord channel. Embeds linked videos and images from users linked Instagram posts, videos, and reels into a Discord chat. Public bot had over 500k users across over 2k servers before being shut down by the owner due to resource restrictions.

Support Discord Server

Features:

See the list of commands to get an impression of how users can interact with the bot.

Example:

Example of reels bot on discord

Setup

See the installation guide for steps to setup the bot. For troubleshooting help, see the troubleshooting guide.

Config.json format:

Create a new file named config.json, copy and paste the contents below into it, fill it out, and then save it in the same directory as the Instagram Embed executable file. Replace any fields that are optional and not filled in with "". Example: "OTPSecret": "",. If you get an error with your JSON formatting, you can check your JSON syntax on jsonlint.com.

{
  "Token": "Token",
  "Prefix": [ "https://www.instagram.com/", "https://instagram.com/", "http://www.instagram.com/", "http://instagram.com/" ],
  "OwnerID": "ID",
  "TestGuildID": "ID",
  "DMErrors": true/false,

  "IGAccounts": [
    {
      "username": "IG Username",
      "password": "IG Password",
      "OTPSecret": "IG OTP Secret (optional)",
      "UsageTimes": [
        {
          "StartHour": optional (int; 0-23),
          "EndHour": optional (int; 0-23)
        }
      ]
    }
  ],

  "ProxyURL": "",
  "ProxyUsername": "username (optional)",
  "ProxyPassword": "password (optional)",

  "DisableTitle": false,
  "EnableDeleteButton": true,

  "AllowSubscriptions": true/false,
  "MongoDBUrl": "MongoDB Connection String (Required for subscriptions)",
  "DefaultSubscriptionsPerGuildMax": 1,
  "HoursToCheckForNewContent": 3,
  "SubscribeCheckDelayTime": 10
}

How does it work?

The executable file connects to a Discord application (the “Discord bot”) with a bot token, processes its commands and controls its actions. As long as the application is running, the bot can be prompted for Instagram content with commands. The executable then uses throwaway Instagram accounts to access Instagram content.

A Discord application can be created via the Discord Developer Portal and then invited to multiple servers afterwards. See installation guide.

To automatically share new posts from Instagram accounts, the subscribe module must be activated. The executable then requires access to a MongoDB database. See subscribe module.