bman46 / instagramembeddiscordbot Goto Github PK
View Code? Open in Web Editor NEWEmbeds videos and images from an Instagram link into a Discord chat.
License: BSD 3-Clause "New" or "Revised" License
Embeds videos and images from an Instagram link into a Discord chat.
License: BSD 3-Clause "New" or "Revised" License
Using this structure:
@mention https://instagram.com/link
The bot does not create an embed.
While the /profile
do work on the account I intend to follow. When I try the /subscribe
command the bot show me this exact message :
"The account appears to be private and cannot be viewed by the bot."
So here is my config.json file (with /
for sensitive datas) :
"Token": "/",
"Prefix": [ "https://www.instagram.com/", "https://instagram.com/", "http://www.instagram.com/", "http://instagram.com/" ],
"OwnerID": "738454617272221787",
"TestGuildID": "/",
"DMErrors": true,
"IGAccounts": [
{
"username": "3rdlanefgr",
"password": "/",
"OTPSecret": "IG OTP Secret (optional)",
"UsageTimes": [
{
"StartHour": "",
"EndHour": ""
}
]
},
{
"username": "markusa.75",
"password": "/",
"OTPSecret": "IG OTP Secret (optional)",
"UsageTimes": [
{
"StartHour": "",
"EndHour": ""
}
]
}
],
"ProxyURL": "",
"ProxyUsername": "username (optional)",
"ProxyPassword": "password (optional)",
"AllowSubscriptions": true,
"MongoDBUrl": "/",
"DefaultSubscriptionsPerGuildMax": 1,
"HoursToCheckForNewContent": 3
}
The @3rdlanefgr
is a public account associated with my real account, @markusa.75
is just a private account. I may be wrong but both should be able to be used by the bot when I type in my server /subscribe (public account)
. Both of these accounts are currently following on Instagram the public account that I intend to subscribe to.
To me, the error message is when the bot show me this on the console :
"Failed to get user. InternalException: Error converting value {null} to type 'System.Boolean'. Path 'user.auto_expand_chaining', line 1, position 5671.."
or for an other example :
"Failed to get user. InternalException: Error converting value {null} to type 'System.Boolean'. Path 'user.auto_expand_chaining', line 1, position 5764.."
Here is a long extract of my console log :
10:46:06 Gateway Connecting
Starting the subscription task...
10:46:07 Gateway Connected
0 Shard Ready
Register Commands...
Global
10:46:08 Gateway Ready
Slash Command Executed
Warning: No time set on account 3rdlanefgr. Using the account.
Logging in
android-9ff84c756d6d868f
Loading state from file
Slash Command Executed
Warning: No time set on account 3rdlanefgr. Using the account.
Logged in
Exception: Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Boolean'. Path 'user.auto_expand_chaining', line 1, position 5700.
---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at InstagramApiSharp.API.Processors.UserProcessor.GetUserInfoAsync(Uri userUri)
Stacktrace: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at InstagramApiSharp.API.Processors.UserProcessor.GetUserInfoAsync(Uri userUri)
Failed to get user. InternalException: Error converting value {null} to type 'System.Boolean'. Path 'user.auto_expand_chaining', line 1, position 5700..
Slash Command Executed
Warning: No time set on account 3rdlanefgr. Using the account.
Logged in
Get username failure: System.NullReferenceException: Object reference not set to an instance of an object.
at Instagram_Reels_Bot.Helpers.InstagramProcessor.GetUserIDFromUsername(String username) in D:\a\InstagramEmbedDiscordBot\InstagramEmbedDiscordBot\Instagram Reels Bot\Helpers\Instagram\InstagramProcessor.cs:line 276
at Instagram_Reels_Bot.Modules.SlashCommands.Subscribe(String username) in D:\a\InstagramEmbedDiscordBot\InstagramEmbedDiscordBot\Instagram Reels Bot\Modules\SlashCommands.cs:line 305
Slash Command Executed
Warning: No time set on account 3rdlanefgr. Using the account.
Logged in
Slash Command Executed
Warning: No time set on account 3rdlanefgr. Using the account.
Logged in
Exception: Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Boolean'. Path 'user.auto_expand_chaining', line 1, position 5671.
---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at InstagramApiSharp.API.Processors.UserProcessor.GetUserInfoAsync(Uri userUri)
Stacktrace: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at InstagramApiSharp.API.Processors.UserProcessor.GetUserInfoAsync(Uri userUri)
Failed to get user. InternalException: Error converting value {null} to type 'System.Boolean'. Path 'user.auto_expand_chaining', line 1, position 5671..
Warning: No time set on account 3rdlanefgr. Using the account.
Logged in
Getting new posts!
Done.
To give you an example about what the bot showed me, I attached to the message some screenshots about the account https://www.instagram.com/todayfood/ that I wanted to subscribe (username : todayfood
).
Screenshot from Discord :
Screenshot from the console :
I hope I have shared all the necessary informations to solve the problem.
Thank you in advance !
Removing the delete message button.
Instagram have a detection of IP, so if is not a residential IP you can't do a request to his API, I tried to solve it on my own, but I have not succeeded, I hope you find a solution, since no one is going to put the bot on your local computer 24/7
I'd like support for spoilers when using text commands just as is available with slash commands.
By updating the prefix to include the two pipes, the bot still recognizes the instagram link.
"Prefix": [ "https://www.instagram.com/", "https://instagram.com/", "http://www.instagram.com/", "http://instagram.com/", "||https://instagram.com/", "|| https://instagram.com/" ]
The bot could register that the prefix contains pipes and use the isSpoiler
parameter in FileAttachment
(like with the slash commands).
It appears the infrastructure is already present, and just needs to detect whether the text command or prefix contains pipes and adjust accordingly.
Allow for mentioning roles when a new post is added.
With Discord making text a privileged gateway, a fallback has to be added to allow for the bot to continue to operate.
A /url
command would probably work well.
Wouldn't it be great if threads could be supported? This would make the bot stand out in a subtle way beautifully.
I understand what the Bot is telling me, but why can't I subscribe to a private account, when I can view the posts of the exact same private Account?
I just would love to understand this.
Thank you in advantage!
Hey, Thanks for making this awesome discord bot. It's so helpful for us.
I just wanna suggest to see carousel post on discord too for new feature. It would be less time consuming for us if you could make this.
Once again thank you for developing this awesome bot. Keep Working on it!
Sometimes, the default discord embedding decides to work, and in these cases we get two embeds for that link, one default and one from this bot. Is there a good way to prevent this?
Bot crashed when checking deleted instagram account. and need to be restarted everytime /subscribed
or checking new posts until account record deleted in mongodb. (example InstagramID 2248802466962)
for ex , node.js is usually npm start
what is it for c#?
Also support urls in the format of: https://www.instagram.com/username/reel/IDString
When the bot get blocked by IG, it reacts as if the account that the bot is subscribed to was deleted from IG and unsubscribes from it.
Workaround: set DisableSubscribeCleanup to false in the config. Restart the bot.
InstagramEmbed subscription only posts the last 3 Instagram posts instead of more.
Can you set the maximum on 25?
The instructions say: "find the file named Instagram Reels Bot
with no extensions". Unfortunately, there is no such file without an extension.
Support Instagram TV links such as the following: https://www.instagram.com/tv/CM0glcNnYS0/?igshid=teu88es4wlqy
I am receiving the following error with longer reels. Images and shorter reels seem to work fine.
Collective file size exceeds the max file size of 8388608 bytes in that guild! (Parameter 'attachments')
Title. Posting it here so we could track it. @bman46
Add support for profiles such as https://instagram.com/google
the guilds command reaches the maximum amount of characters in a message which results in the message not being sent. Needs to be updated to break the list down into multiple messages.
Add a command to get a specific story from a profile.
Allow for a user to delete embeds that may be accidentally added. Only the user that triggered the embed should be able to use this function.
me again :)
The bot doesn't start in tmux for me. I downloaded the current IGReelsBot-2.12.0-linux-x64.tar, unpacked it and put it on my server. Started tmux with "tmux new -s instagram" in the bot's folder and started node "Instagram Reels Bot". Then get an error:
Instagram Reels Bot:1
ELEVEN
^
SyntaxError: Invalid or unexpected token
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1078:15)
at Module._compile (node:internal/modules/cjs/loader:1113:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1203:10)
at Module.load (node:internal/modules/cjs/loader:1027:32)
at Module._load (node:internal/modules/cjs/loader:868:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.10.0
Add a /latest
command to get the latest post for an IG account.
Things to do:
Will probably fix by reacquiring the url on a refresh emoji click. Links expire after an estimated 2 days.
Add an option to change the time that the subscribe module waits between checking accounts.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.