How to make a discord bot to check if member is inside the server

I am making a discord application but on roblox and I want to check if the user is inside the server so he can start the application

Hey!

I suggest you to do a discord webhook so you can send data from roblox to discord

Since discord blacklisted roblox http thing, you can use this!

Make once the player join the game, it sends a message/embed to discord!

Great idea to avoid being blacklisted nut, but I meant how to check if he is inside the discord server, looks like I mistyped

This is possible by a Discord Bot and an API, but I’m not sure how.

nevermind, You could: verify your users from the discord bot and store their Discord Id and their Roblox Id and send all user data by POSTing a json data (ex: {users: [[robloxId, discordId], [1, 123456789]}) from the API and create a GET request to find the user from the temporary list of users saved from the api.

example POST: https://userapi.domain.name/storedata
You should temporarily store the data from the API, just make sure you have enough RAM to store a large list of users.

example GET: https://userapi.domain.name/getuser?user=1
the ?user=1 will find the user with a roblox id of 1

I can give you an example of the API if you are still trying to work on this.

1 Like

I tried this but it gave me error
client.on(‘message’, message => {
if (message.content === ‘!start’) {
if (!message.member.guild.id === ‘guild id’) return message.channel.send(‘You are not inside server!’);
message.channel.send(‘You are inside server!’);
}
});

You need to use == and not === in that situation.
=== is used for type-sensitive comparisons, while == is not.
You need to use == because you are comparing a string (the server ID) to an object (the Discord guild). === would just tell you that they are not the same type, while == will convert the object to a string and compare those.
The correct code would be:
client.on(‘message’, message => {
if (message.content === ‘!start’) {
if (message.member.guild.id == ‘guild id’) return message.channel.send(‘You are not inside server!’);
message.channel.send(‘You are inside server!’);
}
});