feat: adapt to v0#5
Closed
null8626 wants to merge 6 commits into
Closed
Conversation
velddev
reviewed
Sep 17, 2025
Collaborator
velddev
left a comment
There was a problem hiding this comment.
revert the public API function names and it seems fine to me
| return res; | ||
| if data then | ||
| return data | ||
| else |
Collaborator
There was a problem hiding this comment.
nit: else not really needed here
| if type(query.fields) == 'table' then | ||
| query.fields = concat(query.fields, ','); | ||
| end | ||
| function Api:get_bot(id) |
Collaborator
There was a problem hiding this comment.
avoid renaming the public API please
Member
Author
There was a problem hiding this comment.
Done, with the exception of Api:init(token); to local client = Api:new(token);.
Member
Author
There was a problem hiding this comment.
Full diff on the API methods:
PRIVATE METHODS:
- Api:commit(method, url, req, body)
+ Api:__commit(method, url, request, body)
+ Api:__request(method, path, body, query)
PUBLIC METHODS:
- Api:init(token)
+ Api:new(token)
- Api:getVotes()
+ Api:getVotes(page)
+ Api:newAutoposter()| local data = self:__request('GET', string.format('/bots/check?userId=%s', id)) | ||
|
|
||
| return self:request('GET', '/bots/votes'); | ||
| return not not data.voted |
Member
Author
There was a problem hiding this comment.
In the API, voted is an integer, not a boolean. But I'll revise this to data.voted ~= 0.
Member
Author
|
Closed in anticipation of a major update that adds v1 support but deletes all v0 features. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following pull request is a toned down version of #3. This pull request focuses solely on the
changes done to the SDK in the v0 of the API. Such as:
setmetatable({}, self)to emulate OOP objects over manual copied code that emulates OOP.EventEmitterimplementation for the autoposter.