N-RTD | Retrieve data from Discord (Service ended)

Also how would you host it bry yourself? Do you mean making your bot responding to the commands instead of mine? If you want you can submit it as a feature request in the support server.

I just wanted like a GitHub repo of the command code, and I could input the code into my own command handler and such, and download all the required packages.

Changelog

Updates and news

The system got a website which is available here. The website has a dashboard where you can manage the service for your server and verify your account.

From now on you can change the API’s check method which means that if it is set to nickname is qual or contains the system will not check for a user that has the nickname equal to the passed username but for a user that has a nickaname containing the passed username this can be useful if you have people with nicknames like: Mod | NinjaFurfante07.

You will need to log in with your Discord account in order to access the dashboard.

Bot changelog

Updates and news

You can now verify your account by using the /verify command.

Upcoming changes to the API

Upcoming changes to API

Later this month the API will receive an important update. From that date on requests to the API will require an API key which you will be able to obtain on your developer page on the website.

You will be notified in the support server (the Discord server) 7 days before the change goes live. Once the update is up requests that provide an invalid API key will be rejected. This will help blocking access to the API to banned users.

Also comment below features you would like to see.

Important notice

There are upcoming changes to the API. On 2022-03-20T04:00:00Z the API reponses will be changed: the API currently sends back a bool value as response, this is unfortunately changed to a string by roblox HTTPService causing some issues with users thinking that the API is not working correctly if they use a code similar to the one below.

local IsAdmin = NRTD:GetUserWithRoleAsync("username", "guildId", "token", "roleId")

if isAdmin then --isAdmin is true/false (bool) when sent by the API, becomes "true"/"false" (string) when received on roblox
    -- grant access to admin commands
end

With the new API version the responses will be a JSON table which you will then need to decode if an automatic decode function is not implemented in the API wrapper. A new response would look like the one below.

-- Code is in JSON

{
    "found": true
}

--OR

{
    "found": false
}

You should start preparing your code to adapt to this change else it will break.

For who was confused with the documentation posted on the website it is actually outdated due to changes that have been made to the API wrapper and will soon be updated. The documentation has been updated

Hey geometrical, sorry for the late reply. Can you please what you mean by “retrieve messages”?

having a few issues

when I run this, I get an error: print(result):4: attempt to call a nil value

where do you find the token for your server?

Also the token of your server can now be found on your dashboard at https://n-rtd.up.railway.app

thanks but now i’m getting a http 401 unauthorized?

local NRTD = require(8247119473)

local result = NRTD:GetUserWithRoleAsync("Ben10Tam", "guildid", "token", "roleid")

print(result)

this is my code, i’ve hidden my guildid, token and roleid but this should work right?

That happens if you have not bound your guild. Use NRTD:BindGuildAsync(“guildId”)

thank you, works now but it’s returning false even though i have the role

You need your discord server nickname set to the username you are passing in the request if your API check method is set to nickname is equal you can change it to return true if the nickname contains the username passed but it’s not exactly equal by setting the API check method to nickname is equal or contains.

1 Like

all working now! thank you so much
but i think you still need to update the api

Ah yes i am updating the docs right now

No problem!

1 Like

API update

As stated here N-RTD | Retrieve data from Discord (Service ended) - #36 by NinjaFurfante07 the update is now live. The API will now send back a JSON response so what you will need to do is HttpService:JSONDecode() the result. An example is provided below to help you adapt your code.

local HttpService = game:GetService("HttpService")
local NRTD = require(pathToTheModule)
local result = HttpService:JSONDecode(NRTD:GetUserAsync("username", "guildId", "token"))

local found = result.found

if found then
    --Give 100 coins
else
    --Do something else
end

NOTE: This update has only affected the main route (https://n-rtd-api-production.up.railway.app/), the other routes for bind and unbind requests remain unchanged.

You should update your code as soon as possible as now just doing if result then can be dangerous as it will always be true.

thank you for helpingAPI Discord

No problem. Anyways n-rtd doesn’t query discord’s api but relies on the bot. Also if you have any feedback please share it :blush:

Hey guys, just a quick news: i set up a page where you can monitor the roadmap but also request features and report bugs at https://norilix.canny.io/

Ok it has been a while since you posted that but i still want to ask what are your concerns about the security and safety of this system.