yitsushi / go-misskey Goto Github PK
View Code? Open in Web Editor NEWMisskey Go SDK
License: GNU General Public License v3.0
Misskey Go SDK
License: GNU General Public License v3.0
Documentation: https://misskey.io/api-doc#tag/admin
User:
Documentation: https://misskey.io/api-doc#tag/admin
Documentation: https://misskey.io/api-doc#tag/admin
Documentation: https://misskey.io/api-doc#tag/admin
Is your feature request related to a problem? Please describe.
I am trying to build a client for misskey in golang.
I was looking for a library for misskey and found this great library and decided to use it. However, it seems that there is no function (like /api/i
) to get a user from a token.
Sorry if I just don't know it.
Describe the solution you'd like
I would like to add the ability to retrieve the user assigned to a token.
I've written a Pull Request to resolve this issue, and I'd like you to Merge it if this is not a problem.
Describe alternatives you've considered
Additional context
Documentation: https://misskey.io/api-doc#tag/admin
Documentation: https://misskey.io/api-doc#tag/admin
Describe the bug
In the [Admin/Emoji/Add] endpoint, there is a lack of parameters which results in an error when calling this endpoint.
๐ Expected behavior
An emoji should be successfully added.
Unable to add emojis due to an error.
๐ Additional context
This issue occurs in Misskey v13.13.2.
https://misskey.io/api-doc#tag/admin/operation/admin/emoji/add
Documentation: https://misskey.io/api-doc#tag/admin
Documentation: https://misskey.io/api-doc#tag/admin
Describe the bug
The CreateFromURL() function in the Drive service module is causing a crash when it is used.
๐ To Reproduce
Code sample:
client := misskey.NewClient("https://host","API KEY")
if file, err := client.Drive().File().CreateFromURL(&files.CreateFromURLOptions{
URL: "https://path/to/some/image.jpg",
}); err != nil {
panic(err)
}
// do something with the file object
๐ Expected behavior
Client passes the create_from_url call to the Misskey API on the server.
panic: reflect: call of reflect.Value.NumField on ptr Value
goroutine 1 [running]:
reflect.flag.mustBe(...)
/usr/local/go/src/reflect/value.go:221
reflect.Value.NumField(0x7e0240, 0xc000028080, 0x16, 0xc000046800)
/usr/local/go/src/reflect/value.go:1369 +0xc5
github.com/yitsushi/go-misskey/core.parseMultipartFields(0x8a4a00, 0xc000028080, 0x20)
/users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/core/multipart.go:19 +0x125
github.com/yitsushi/go-misskey/core.(*MultipartRequest).ToBody(0xc0000ca020, 0x845f96, 0x20, 0x0, 0x8a47c0, 0xc00009a180, 0xc00001c1b0, 0x23, 0x23, 0x0)
/users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/core/multipart_request.go:38 +0x1a5
github.com/yitsushi/go-misskey.Client.sendRequest(0x83fe9c, 0x11, 0x845f96, 0x20, 0x8a4cc0, 0xc00009ad20, 0xc0000fe070, 0x8a9160, 0xc0000ca020, 0x7c3fa0, ...)
/users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/client.go:64 +0x82
github.com/yitsushi/go-misskey.(*Client).requestHandler(0xc0001117f0, 0x8a9160, 0xc0000ca020, 0x7c3fa0, 0xc0001fc000, 0x29f01, 0xc0000ca020)
/users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/services.go:21 +0x114
github.com/yitsushi/go-misskey/services/drive/files.(*Service).Create(0xc000111770, 0x83d9a7, 0xa, 0xc00056c3c0, 0x18, 0x0, 0xc000600000, 0x29ffa, 0x30000, 0x0, ...)
/users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/services/drive/files/create.go:25 +0x137
github.com/yitsushi/go-misskey/services/drive/files.(*Service).CreateFromURL(0xc000111770, 0xc000111828, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/services/drive/files/create_from_url.go:31 +0x17e
main.main()
/users/mick/testbot/main.go:169 +0x3a5
๐ Additional context
n/a
Describe the bug
Some of the requests have missing omitempty
annotations, because of that, the request will contain the field with default value (empty string or 0
) and Misskey will handle them as requested value and not as an optional field.
๐ Expected behavior
All request structs have proper JSON annotation.
Some of the request structs have improper JSON annotation.
๐ Additional context
Reference: #93
Documentation: https://misskey.io/api-doc#tag/admin
Is your feature request related to a problem? Please describe.
The admin/queue/jobs
endpoint return value depends on the requested Domain
. For example Deliver
has a very simple structure with only a "To" field in Data
, but Inbox
contains the while ActivePub Activity object.
Describe the solution you'd like
Maybe #44 gives us the ability to parse the response the right way.
Describe alternatives you've considered
I have no idea now.
Additional context
Related issue: #66
Documentation: https://misskey.io/api-doc#tag/admin
Only one endpoint: ap/show
Documentation: https://misskey.io/api-doc#operation/ap/show
Some of the endpoints can be called without authentication. Some of them returns with different body (not all fields are populated). For simple requests like Instance Metadata, it's can be useful to provide a way to call it without token, for example Instance aggregators.
Documentation: https://misskey.io/api-doc#tag/admin
Documentation: https://misskey.io/api-doc#tag/channels
This one will be tricky... Never did it before, so I have to do some extra research on the topic.
Requests:
User().Pinned()
or something similar to fit in the service properly)Documentation: https://misskey.io/api-doc#tag/antennas
Documentation: https://misskey.io/api-doc#tag/admin
No context, title tells the full story.
Fix issues with a nice PR.
File: https://github.com/yitsushi/go-misskey/blob/main/CONTRIBUTING.md
Acceptance Criteria:
go test ./...
calledgolangci-lint run --enable-all
calledOptional:
go test
coverage reported to coveralls.Documentation: https://misskey.io/api-doc#tag/admin
Search:
Timeline:
Polls:
Favorites:
Watching:
Reactions: (related: #14)
Extra:
Documentation: https://misskey.io/api-doc#tag/notes
It will be more than one PR, most likely. This section has a ton of endpoints.
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.