Robux Purchasing Bot

Hello, I’m looking to be making a Discord Bot where when a user purchases a shirt or a in-game asset, they then go to a channel and do !purchases and the Bot looks to see if they bought said asset.

If they didn’t then it will respond with something mentioning it didn’t find anything in the system

But if they did and the Bot has registered it and found it, it dms the message author with the product / information.

Just loking for some main tips or any tutorials if this has been completed previously as I haven’t found anything from research.

Why would you overcomplicate things? Why not just handle everything in-game?

I see these types of posts all the time - it is not that difficult to break a problem down. These posts just flood categories and push down posts from people with actual problems. Don’t just search up your exact problem, that won’t get you anywhere. Instead, break up your problem into smaller, manageable problems.

With your specific scenario, a good first start is to detect when a purchase is completed. With a quick google search you can easily find this information. For developer products, use MarketPlaceService.ProcessReceipt. For game passes, use MarketPlaceService.PromptGamePassPurchaseFinished. When these events have been fired, simply hook them up to a function that sends a message to a Discord webhook. There are so many topics on this you can find a solution in a matter of seconds, like this. Please note that Discord has blocked requests from Roblox as of late 2021, so you will need to use a proxy.

Regarding the bot section, that has absolutely nothing with Roblox. You can send a message through a webhook to a Discord channel, but after that you’ll need to create a Discord bot using Discord’s API. I have some experience with this and I personally recommend discord.js, or discord.py if you prefer using Python. I recommend using a third-party library instead of Discord’s direct API because that API can be quite tricky to work with, especially for beginners.

TL;DR

Only use this category as a last result and break the problem down instead of complaining that you haven’t found an existing post on your exact problem.

1 Like

Because it sends the user easier posted instructions and prevents people from causing issues in the game itself

I understand the webhook situation however how would I make it so directly message that user? A Discord Bot can do such a thing but Webhooks do not.

The player would need to visit the game anyhow, also the fact that more than 50% of Roblox’s playerbase is under 13 and Discord is a 13+ application.

I don’t understand, it’s clicking a button vs typing out a command where you can’t get a single letter wrong.

Because when the code itself is sent the user will need to redeem it using the Discord Bot anyway…
So all they need to do is either:
Purchase shirt, do !purchases, code is sent in dms and then they redeem it in dms.

Why not just check if the player owns the shirt with PlayerOwnsAsset?

What would the use for that be, if the code is given then another user will at some point be given the same code and it won’t be able to be redeemed.

Normally, you’d do a HTTP and use GET to see if the user owns an asset, but unfortunately this function is not in the API yet. So, you can’t check if a user owns an asset through HTTP or external platforms like Discord.

Solution: You have to do this in a complicated way. You know Roverify and Bloxlink right? Both of them requires you to go ingame to check if you are the said user in Discord. So you can also use this method and have users go ingame to check if the user is the valid user in Discord, then give them the appropriate roles if they own the asset. Or if you already have the user verified on Discord, just have them go in game so you can check if user owns the asset and then give them the roles. I think you need to use HTTP and use POST to let Discord know that the user is valid in Discord and that he owns the asset.

Why are you generating codes every time a player buys a shirt, just so they can redeem something? Why don’t you just check if the player owns the shirt, then let them redeem whatever?