affenity / bloxy Goto Github PK
View Code? Open in Web Editor NEWInteract with the Roblox website and API
License: MIT License
Interact with the Roblox website and API
License: MIT License
When running:
roblox.buyAsset(2480046724, 7, 4125826);
I am unable to purchase a asset.
When I print the value group.getmember(id) the name and displayname are null but the id and roles are there.
From SyncLinear.com | BLOXY-13
Hi there, I see that your library is making use of my public verify.eryn.io API. That's super cool!
The verify.eryn.io API has an enforced rate limit of 60 requests per 60 seconds. The docs ask the developer to enforce that limit locally, instead of sending out an unmetered number of requests as your library currently does here.
It would be great if you could throttle requests if the user exceeds this limit. You can use a library like p-throttle to throttle this method without much effort; in this case you'd pass the function, followed by 60, 60000
to indicate a maximum of 60 calls in 60 seconds.
Also, if you want to future-proof your library, make sure that it follows redirects, as the API endpoint will be changing in a few months.
Thanks!
Says it is well documented, but I can't find it anywhere. A good shove in the right direction will be most helpful.
Yes I know why okthxbye
I'm experiencing token validation errors with the current way how tokens are handled. (on v5.0.2)
There are two different bugs:
To fix the second bug, I think the interval can be made shorter to something like 3 minutes.
However, I haven't found a good way to fix the first bug (have tested some solutions like immediately refetching the token after the firsts fetch). The only solution that fixed this is what I PR'd in the dev version as well: always refresh the token instead of based on an interval (what noblox.js also still does).
You will probably see a similar PR by me soon.
I'm working on rewriting my API in TypeScript and noticed that all bloxy now exports is the Client.
It would be nice if all types are exported too, so I don't have to import them from their respective modules directly.
.
Hello.
Recently, I noticed that the Group#properties have an issue with the .shout
& .memberCount
properties.
This is the code I have:
const Discord = require('discord.js');
const bloxy = require('bloxy');
const bloxyClient = new bloxy();
const groupId = '4366007';
module.exports.run = async (bot, message, args) => {
bloxyClient.getGroup(groupId).then(group => {
let embed = new Discord.RichEmbed()
.setColor('BLUE')
.setAuthor('Group Information', bot.user.displayAvatarURL)
.addField('Group Name', group.name)
.addField('Group ID', group.groupId)
.addField('Membercount', group.memberCount)
.addField('Owner', group.owner.username)
.addField('Description', group.description)
.addField('Current Shout', group.shout.body);
message.channel.send(embed);
});
}
On the Membercount
& Current Shout
fields, it shows:
Membercount; the membercount of approximately 1 week ago.
Current Shout: the group shout which was made 1 week ago.
In my side of view, this is an issue which should be fixed as many people may be using those properties on their bot and the bloxy source is giving incorrect information on those two properties.
User-reported:
should remove /v1/contacts/match and /v1/contacts/update from the friends and contacts objects, since the endpoints no longer exist since a few weeks ago
Verify and submit PR
Example: the Catalog API has them set but the Groups API hasn't.
This way the validStatusCode response handler can't do its job correctly.
Now for example if you try a method that your user isn't permitted to do (like GroupsAPI.payoutMembers on a user that's not the regarding group's owner), the Roblox API will throw a 403 and since the method in the Groups API doesn't have the allowedStatusCodes set, bloxy will think the request was successful.
There seems to be a conflict in the UserPresenceType stored in the User
class
In the User
class, the userPresenceType
value in the presence
field is of type string
, however this can be populated in three ways:
Through the Presence API
The Presence API returns a string, as shown here:
https://github.com/Visualizememe/bloxy/blob/25f3940d49edf3acb63d740c41e4f2e336b6ec49/src/client/apis/PresenceAPI.ts#L16
Through the Friends API
The UserPresenceType can be returned in the Friends API. This is stored as a string, as shown here:
https://github.com/Visualizememe/bloxy/blob/25f3940d49edf3acb63d740c41e4f2e336b6ec49/src/client/apis/FriendsAPI.ts#L126
Through the Profile Header
In the profile header, the UserPresenceType returned is a number, as seen here:
https://github.com/Visualizememe/bloxy/blob/25f3940d49edf3acb63d740c41e4f2e336b6ec49/src/client/apis/OtherAPI.ts#L14
which is then used to create the User object:
https://github.com/Visualizememe/bloxy/blob/25f3940d49edf3acb63d740c41e4f2e336b6ec49/src/client/Client.ts#L103
Here is the mapping between numbers and string:
0 - "Offline"
1 - "Online"
2 - "In Game"
3 - "In Studio"
The UserPresenceType stored here is conflicted with the type for the User object. There needs to be a decision made to ensure this is kept uniform in all locations
Hey, @Visualizememe, can ya update bloxy on npm. Thanks!
When i try to run my bloxy code it outputs this error:
Error: Failed to retrieve module "got" and no custom requester provided!
at getRequester (C:\Users\kvand\OneDrive\Bureaublad\JS Devproduct\node_modules\bloxy\dist\controllers\rest\lib\getRequester.js:10:19)
at new RESTController (C:\Users\kvand\OneDrive\Bureaublad\JS Devproduct\node_modules\bloxy\dist\controllers\rest\RESTController.js:38:53)
at new Client (C:\Users\kvand\OneDrive\Bureaublad\JS Devproduct\node_modules\bloxy\dist\client\Client.js:17:21)
at Object.<anonymous> (C:\Users\kvand\OneDrive\Bureaublad\JS Devproduct\index.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
No matter what i do nothing seems to help.
await client.apis.publishAPI.uploadAssets({ files: 'test.rbxm', }).then(data => { console.log(data.AssetDetails); }).catch(err => { console.log(err); });
When I try the above, it returns an empty array as the promise. Any reasons why this may happen?!
A major rewrite of bloxy has been in the works for some time now. For the sake of transparency, I want to include updates and what's remaining before launching a new version in a beta phase.
TL;DR: Easier to use, tons of new features (oauth, realtime, open cloud, typed endpoints, retries, type-safety and much more). Around the time of launch you'll be able to read more about the features on the brand new docs site. Supports ESM and CJS. Coming soon™️
High-level view of the new features that are coming:
Release:
This is in active development and is expected to launch mid-february 2024. Although many features are complete, I need to set up testing and reliability tests.
What's changing (breaking):
The new bloxy version will have several notable changes. Most notably, the new version (X) has 100% breaking changes. Although a considerable amount of syntax and naming is familiar, they have all changed due to the nature of the new version. If you wish to upgrade to the new version, you must adapt to the new structure.
From SyncLinear.com | BLOXY-15
Upon using createDeveloperProduct, I get this error shown:
BloxyHttpError [BloxyHttpInvalidStatusCodeError]:
Invalid status code in response. Body: {"errors":[{"code":0,"message":"No HTTP resource was found that matches the request URI 'http://develop.roblox.com/v1/universes/2095224927/developerproducts'."}]} | Status code: 404, status: undefined. Possible reasons:
- Invalid request method (i.e. POST instead of GET)
- Resource removed / updated to another route
- You're not logged in (use .login on the client to log in)
at validStatusCode (C:\Users\Spiral\Desktop\bot\node_modules\bloxy\dist\controllers\rest\response\handlers\validStatusCode.js:30:29)
at C:\Users\Spiral\Desktop\bot\node_modules\bloxy\dist\controllers\rest\response\RESTResponse.js:12:78
at Array.map (<anonymous>)
at RESTResponse.process (C:\Users\Spiral\Desktop\bot\node_modules\bloxy\dist\controllers\rest\response\RESTResponse.js:12:63)
at RESTRequest.<anonymous> (C:\Users\Spiral\Desktop\bot\node_modules\bloxy\dist\controllers\rest\request\RESTRequest.js:26:29)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Spiral\Desktop\bot\node_modules\tslib\tslib.js:111:62)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
statusCode: 404,
status: undefined
}
I believe that this is the doing of Bloxy itself and not my code. I will not post my code publicly so if you feel you need to review my code for further investigation, contact me at SpiralRBX#5787
Implement https://data.roblox.com/Data/Upload.ashx?assetid=
Use of this can be seen in rojo's upload function in their CLI.
https://github.com/rojo-rbx/rojo/blob/master/src/cli/upload.rs
My suggestion was originally made in the Roblox API discord.
This is a suggestion to remove the need for Client.initWS(). This can be pretty confusing, this solution could fix this.
My suggestion is that for classes which extend event emitters, (I.e. Group/GroupFunctions) A listener is added for the newListener event.
Within this listener, it would check if the websocket has been initialised. If it hasn't, it would initialise it. It would then emit an error if this fails.
This means that:
Disadvantages:
EventEmiter
.Example implementation (Pseudo code):
const WS = // Get websocket object somehow
Class Example extends EventEmitter {
constructor () {
this.on('newListener', function (eventName, listener) {
if (!WS.active) {
WS.init()
}
})
}
}
Group.getJoinRequests has a return type of GroupJoinRequest (only declared and used in that file) with incorrect fields.
The method is basically a proxy to GroupsAPI.getJoinRequests which has a return type of GetJoinRequests.
The difference (and thus the bug) here is that GroupJoinRequest has fields like user, group, ... (which the Roblox API doesn't return) and GetJoinRequest has the correct fields: requester & created.
The implementation of these methods is correct, this is a typing bug only.
Whenever I try to use bloxy but need to install a new package it just stops working. Error:
Error: Failed to retrieve module "got" and no custom requester provided! at Object.getRequester [as default] (C:\Users\Owner\Downloads\RankBloxCode\node_modules\bloxy\dist\controllers\rest\lib\getRequester.js:10:19) at new RESTController (C:\Users\Owner\Downloads\RankBloxCode\node_modules\bloxy\dist\controllers\rest\RESTController.js:38:48) at new Client (C:\Users\Owner\Downloads\RankBloxCode\node_modules\bloxy\dist\client\Client.js:17:21) at fetchRobloxRank (C:\Users\Owner\Downloads\RankBloxCode\suspensions.js:87:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Client.<anonymous> (C:\Users\Owner\Downloads\RankBloxCode\suspensions.js:53:26)
When I reinstall it using: npm i bloxy --force it works again.
Error thrown:
Error while withdrawing: Error: Failed to payout. Status code: 404, status message: Not Found
at RobloxGroup.exports.run (path\to\node_modules\bloxy\src\group\methods\payout.js:32:41)
at process._tickCallback (internal/process/next_tick.js:68:7)
Method used:
const memberObj = {
userId: 123456
amount: 123
}
await group.payout({
members: [memberObj],
recurring: false,
usePercentage: false
});
I'm getting this error when using the REST api:
RequestError: fn is not a function
at Request._makeRequest (C:\Users\terri\Projects\Misc\nypd-shutdown\node_modules\got\dist\source\core\index.js:1177:19)
at C:\Users\terri\Projects\Misc\nypd-shutdown\node_modules\got\dist\source\core\index.js:328:28
at Request._makeRequest (C:\Users\terri\Projects\Misc\nypd-shutdown\node_modules\got\dist\source\core\index.js:1124:43)
at C:\Users\terri\Projects\Misc\nypd-shutdown\node_modules\got\dist\source\core\index.js:328:28
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
code: undefined,
timings: undefined
}
This is my code:
const Response = await RobloxClient.rest.request({
method: "POST",
request: {
method: "POST",
body: JSON.stringify(ShutdownForm),
},
path: "games/shutdown-all-instances",
url: "https://www.roblox.com",
requiresAuth: true,
json: true
}).catch(console.error)
This happens on the dev branch:
For the first request that requires a token, a token is fetched from the auth login API, then it's never refreshed again. This starts causing token validation errors when Roblox refreshes the token.
There are three ways I can think of that can fix this:
Hey there! I've been looking on the code, and saw in the authentication module that there's an option to specify a 2captcha key? Thanks in advance! :-) ~Jonas
Implement https://twostepverification.roblox.com/docs#/ to bloxy.
Yeah, it's basically being used for one thing: merging objects. It adds a looot of extra size, and should be removed from the face of the earth.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.