tea-ayataka / kordis Goto Github PK
View Code? Open in Web Editor NEWA lightweight and stable Kotlin wrapper for the Discord API
License: Do What The F*ck You Want To Public License
A lightweight and stable Kotlin wrapper for the Discord API
License: Do What The F*ck You Want To Public License
[03:32:42] [ERROR]: Failed to handle the event! (type: GUILD_DELETE, json: {"id":"0000000000"})
java.lang.NullPointerException: data["guild_id"] must not be null
at net.ayataka.kordis.websocket.handlers.GatewayHandler$DefaultImpls.deserializeServer(GatewayHandler.kt:14) ~[Kordis-a6530c1.jar:?]
at net.ayataka.kordis.websocket.handlers.guild.GuildDeleteHandler.deserializeServer(GuildDeleteHandler.kt:10) ~[Kordis-a6530c1.jar:?]
at net.ayataka.kordis.websocket.handlers.guild.GuildDeleteHandler.handle(GuildDeleteHandler.kt:14) ~[Kordis-a6530c1.jar:?]
at net.ayataka.kordis.websocket.GatewayClient.handleEvent(GatewayClient.kt:395) [Kordis-a6530c1.jar:?]
at net.ayataka.kordis.websocket.GatewayClient.handleMessage(GatewayClient.kt:385) [Kordis-a6530c1.jar:?]
at net.ayataka.kordis.websocket.GatewayClient.onBinaryMessage(GatewayClient.kt:333) [Kordis-a6530c1.jar:?]
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385) [nv-websocket-client-2.8.jar:?]
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276) [nv-websocket-client-2.8.jar:?]
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996) [nv-websocket-client-2.8.jar:?]
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755) [nv-websocket-client-2.8.jar:?]
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) [nv-websocket-client-2.8.jar:?]
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) [nv-websocket-client-2.8.jar:?]
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45) [nv-websocket-client-2.8.jar:?]
I apologize if I've glossed over something, but I can't find tests for editing channels, nor examples.
Adding tests for creating, editing channel permissions and then deleting said channel would be nice.
ex. Joining and leaving voice channel
Looks like currently the tests are tied to a specific discord server.
So it is quite hard to contribute.
What about rewriting tests to use WireMock or something similar, to not depend on the live discord?
I'd be happy to rewrite currently existing test and contribute.
I made my own impl with the API like so, you're free to use it / implement it however you're doing API requests
/**
* [emoji] is the single unicode Char you want to react with
* [encode] is if you want to URI encode your [emoji]
*/
fun Message.addReaction(emoji: Char, encode: Boolean = true) {
val encodedEmoji = URLEncoder.encode(emoji.toString(), "utf-8")
val url = "https://discord.com/api/v6/channels/${this.channel.id}/messages/${this.id}/reactions/${if (encode) encodedEmoji else emoji.toString()}/@me"
val body = RequestBody.create(MediaType.parse(""), "")
val request = Request.Builder()
.addHeader("Content-Length", "0")
.addHeader("Authorization", "Bot ${getAuthToken()}")
.url(url).put(body).build()
OkHttpClient().newCall(request).execute()
}
It would be nice to properly support this however
Edit: getting a list of reactions for a message would also be nice to have, so you can remove them based on name and the such
Hi, this commit (8d4d96f) removes the ability to get the entire member list. I understand this is a Privileged Intent, but your bot only requires verification for such permissions once it's inside more than 100 servers (and you also cannot apply until you have 75 servers).
I didn't realize until now as I switched from using 0.2.3 to the latest commit as I saw it had newer API support. It would be nice to readd this functionality with a check for privileged intents.
net.ayataka.kordis.exception.DiscordException: Discord API returned status code 400 with body {"delete-message-days":["int value should be less than or equal to 7."]}
Discord limited int value to be less than equal to 7.
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.