Getting User profile connections with a bot account - discord.js

I'm trying to add a feature to my Discord bot: when my Twitch account gets a new follower, and if the follower's Twitch account is linked to his Discord account, when he gets into my server he's getting automatically a new role.
So my question is: can I get the Discord's linked apps of a user, and get the user ID linked to those apps?
Like getting the Twitch's user ID of the new follower and compare it with with the Discord's linked Twitch user ID of the users of my channel using Discord.js?

At the moment, the API doesn't allow fetching the profile (and so its connections) from a bot account. The discord.js library has a method to do this (User.fetchProfile()), but it will only work on self-bots (Discord can ban you for using them).
Discord Dream Land has an active idea on this topic: link

Related

Let users join discord server programmatically

We are developing a react-native app where the client wants a 'Join Discord' button.
We also want to track if the user has joined our server or not.
So we want:
A Join button which will prompt users to log into/register with discord and join our server. The button will be greyed out if the user has already joined the discord server.
We can create personalized invite links for each user, store links related to each user in db and track the 'uses' of each link to check if the user has joined or not. This is an indirect method, but might work.
We also thought of creating an input field on the react-native app for discord usernames and just checking if that particular user is part of the server already or not.
Both of these implementations seem to be a hassle (for end user or for us)
Is there any better alternative?
Like login using discord and join server?
First of all, you need to make the user login to discord and to your service via discord oauth2. Save user's ID because you need it soon. Then use a bot, add it to your server and check whether that user is in the server or not, and grey the button if he's present. If not, let the bot generate invite link with only one usage, or better yet, make user login with join servers scope, and add user to your server with his auth token.

Can a Discord Bot Invite Other Bots?

Can a Discord bot invite other bots? Can Discord bots automatically accept invites they get in a DM? How would one go about doing this?
Is it possible to make a bot that accepts invites, or do bots have to be invited themselves.
No, this is not possible.
Users must invite the bot themselves to join the server. I'm not sure I understand the use case here, because users can get similar functionality by simply inviting the bot.
To generate an invite link, start by heading to the Discord developer portal.
Then, head to the "OAuth2" tab:
Scroll down and find the URL generator. You'll need to select the following:
Generally you'll want to calculate the permissions, but this will work for now.
Now, if you want users to invite your bot, you just need to share them this link!

How to add or remove users from a Discord server via the API

I am selling a SaaS product that comes with a Discord server for users. This is a renewal product, so if the user's license expires then I would like to remove them from the server.
How can I achieve this? What input will they need to give me? Is it best to have a login with discord button on my website or should I just have them give me their username then I can send them an invite link when they register, and remove them if their license expires using the API. What if they change their username?
I have done my best to figure out how to achieve both of these approaches by reading https://discordapp.com/developers/docs/intro, but I feel their documentation is seriously lacking and it is difficult to find what I need.
EDIT: It would also be useful to be able to generate one time only invite links. Once the user clicks the link, their discord user ID is sent to me so I can add it into the database. Then, say every day, I scan the database for expired users and if that user has expired then I invoke kick https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.kick. Is this possible?
you get their discord id as soon as they join the discord server by using
client.on('guildmemberadd', (member) {
console.log(member.id)
{```
from there you can hook in your database and simply create a entry containing their
member.id member.username and whatever else you require by a join date Date.now()

Kik bot able to join a group

I've been playing with the REST API for writing kik bots and it seems very straightforward to do powerful things.
The kik bot I'm familiar with is RAGE, and that has a feature that when talking to it you send it 'friend' command and it responds by being your friend, which makes it able to be invited into a group you're in.
My question is, what API call is being made by the bot when it receives a 'friend' command. My test bot can't be invited to a group and I'd like it to be able to.
Feels like I'm missing a bunch of logic but not sure what - anyone assist?
Rage bot does not use official kik api Rage bot is not a bot account from kik, It's an user account. Hence It's a self bot. There is an open source python library that allows you to turn an user account into a Bot and Rage bot uses that exact same api you can find the github page here

How to get list of all the servers to which discord owner is connected

Is there any API to get list of all the servers to which the discord owner(user) is connected.
I want to write a bot to manage all the servers connected to discord owner's account.
As Jeremy mentioned you can use  https://discordapp.com/developers/docs/resources/user#get-current-user-guilds if logged in as the user you're trying to get guilds of. A total list of Guilds isn't possible to get for other users though, you'll only get mutual/shared guilds displayed for others.

Resources