Discord.js 13.7.0 | Node.js 16.5.5
Hi all, could I somehow get information on how many servers/guilds someone has?
I want this information to be added to the command userinfo
Example from dyno dashboard https://i.stack.imgur.com/8kkJP.png
You are only able to get the amount of servers your bot client is in.
To get the amount another user is in you need to use Discord's OAuth2 with the guilds permission. Documentation here. This is not possible with Discord.js in any of the documentation. You can check the User docs if you would like.
If you are creating a dashboard like the image provided, just have your guests log in and require guilds in the permissions scope. Try going here: https://discord.com/developers/applications/<your application ID>/oauth2/url-generator and then check the documentation for the methods to display on your website.
Related
I'm making a discord.js bot and I want to read user integrations from the user id. But I can't find it from the docs and I don't know how to do it. Since I can see the integrations when I log in, I think that it would be available with discod.js, too. How can I do it?
You just can't fetch user connections without using Oauth2, unfortunately.
I've looked online for quite some time now, and I have come up empty. I am working in C#, and I am trying to locate the code I can use to get the liveChatId so I can post to livestream chat. Even the "Try it now" section of Google's example resource https://developers.google.com/youtube/v3/live/docs/liveChatMessages/list#try-it asks for the liveChatId as well. I know I need to make a HTTP GET request, but I really need the actual code that will allow me to do this.
Assistance is GREATLY appreciated.
Here, from the very documentation you provided:
The liveChatId parameter specifies the ID of the chat whose messages will be returned. The live chat ID associated with a broadcast is returned in the liveBroadcast resource's snippet.liveChatId property.
That means you first need to get your liveBroadcast resource. You can obtain those at the liveBroadcasts.list endpoint. If you want to retrieve broadcasts that you (or a user of your application) is the owner of, you might consider authenticating with OAuth 2.0 and using the mine parameter.
I have created several Telegram bots. They work for my account and also on several other accounts that I have tested with.
But I get reports from several users saying the bots never respond.
It there some user setting that would prevent an account from getting messages from bots? Or any other idea why it would not work for some accounts?
Okay, found the issue, it was pebcak.
This issue was it was failing for users that had no last name set in their account because our code was accessing the last_name from the json data.
So make sure your code does not rely on a first or last name.
But I get reports from several users saying the bots never respond.
This is very unusable information. In default all users are equal for the bot usage and no difference between any users if you don't implement it programmatically. But if they says so then try send the POST query to those users in Postman for example and take a look in response. After this it must be clear what kind of problem there.
An example of POST:
https://api.telegram.org/bot{your_bot_token}/sendMessage?chat_id={user_chat_id}&text=test
Note that chat_id those users required.
I'm trying to test my Instagram app in sandbox, I'm trying to get some stats and alerts on new/lost followers ... but is not possible because of sandbox limitations; followers to the authAccount are hidden. I understand I cannot access accounts out of sandbox as main accounts, but I should be able to check ALL followers and followings.
Please Instagram team fix this!
I want to test pagination, but this is impossible because of sandbox limits.
As it is set now,
https://api.instagram.com/v1/users/self/follows?access_token=XXX&count=100
returns just an empty result
It's not broken, this is by design.
You need two things:
Include follower_list as one of the scopes when you authenticate
Add some users to your Client's Sandbox
Once you have the appropriate scope and a few users in your client's sandbox you can have the sandbox users follow each other. Queries generated by a sandboxed client will return only users that you manually added to the sandbox.
It's kind of confusing but that's what got me going.
Probably it because of sandbox limitation, recently faced smth similar http://progrnotes.blogspot.co.uk/2015/11/instagram-api-search-by-tag-doesnt.html.
I think you need to have test users in folowers, and you will be able to see them via api
It's due to the fact that you're in Sandbox mode. I can't see it either. You'll need to apply for the permissions starting December 3 to gain access to the followers list scope.
I think there actually is an issue. Even with correctly configured OAuth permissions in sandboxed mode!
Today, there are several endpoints that deals with followers.
self/follows
Example:
https://api.instagram.com/v1/users/self/follows?access_token=ACCESS-TOKEN
self/followed-by
https://api.instagram.com/v1/users/self/followed-by?access_token=ACCESS-TOKEN
Now, obviously the API uses the access-token to get the proper information. So, the only list it can return here is the list of users that the current authenticated user follows or is followed by.
In the previous API, there was an API endpoint that looked like this
/users/[user-id]/follows?access_token=ACCESS_TOKEN
This endpoint is still valid but works exactly the same as self/follows and self/following, that is, only useful for the current authenticated user. That is, in-sandboxed-mode! Will post if I can get passed the find folks at the Instagram review board. (This is I guess the only way to properly test this.) However, there are no documentation of this use of the API so it may very well not work.
This leaves us with the following API endpoints:
{user-id}/relationship
Example
v1/users/{user-id}/relationship?access_token=ACCESS-TOKEN
Again, this will obviously only return the status of the relationship between the currently authenticated user and the user with the user-id supplied in the url.
I'm trying to get medida data from Instagram via their REST service. I've got an access token and tried to get some media data, I'm using this query
https://api.instagram.com/v1/users/184692323/media/recent/?access_token=
I get this response
{"meta":{"error_type":"APINotFoundError","code":400,"error_message":"this user does not exist"}}
The user ID does exist, I actually tried to use Lady Gaga's user ID, which I got from here: http://jelled.com/instagram/lookup-user-id#
When I use my user-id, it works. It just seems to not work with other user ids.
What can I do? Is this something related to these new "sanbox" rules?
I think you are still running in Instagram Sandbox-mode: https://www.instagram.com/developer/sandbox/.
Citing their page: For example, if you query the /users/{user-id}/ endpoint and the {user-id} is a sandbox user, then you will get the normal API response; but if the {user-id} is not a sandbox user, you will get a APINotFound error.
I have the same issue for non-Sandbox users, which are public but nevertheless Instagram returns it's not a valid user. So the docs seem to be correct.
the user exits, but you may be blocked by instagram for spamming, usually you get that response if spam was detected by an account, try with different user access_token, it should work.
I am very late but you need to invite the user in your application's sandbox and he needs to accept your invitation to actually get any information out of it.
In addition to what Dennis said,
You need to submit your App for review if you're doing things with public profiles. It's not super complicated, but you'll need to build an actual use case for them to approve your app out of sandbox mode.
Or, you can add the users you want to play with to your sandbox app.