WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

caoimhebyrne/KDiscordIPC

Repository files navigation

MAINTENANCE NOTE

Hi everyone!

KDiscordIPC is entering maintenance-only. This means it will not be receiving any new features, and will only be updated for major bug patches.

That being said, I'm working on a new library: JDiscordIPC. It aims to be more robust, easier to use, and lightweight. It's still in early development, but once it's in a usable state I will be archiving this repository.

Thanks for your support, and I hope to see you all over at the JDiscordIPC repository.

Much love, Caoimhe.

https://github.com/caoimhebyrne/JDiscordIPC

KDiscordIPC

Current version: 0.2.2

A lightweight and easy to use Discord IPC wrapper for Kotlin

Many other Discord RPC / IPC libraries are either lacking in features, don't work on certain architectures or platforms, or are no longer maintained. KDiscordIPC aims to stay up-to-date for as long as the Discord IPC API is actually supported

For documentation on how to use KDiscordIPC, check out the wiki!

Features

  • Easy to use Kotlin DSL
  • Coroutines based
  • KDiscordIPC will work on any platform that supports Java (and Discord), due to using junixsocket, a library that has support for many unix based operating systems, and architectures. On Windows, KDiscordIPC will use the RandomAccessFile API
  • Aiming to have full interop with Discord's GameSDK

Install

You can add KDiscordIPC to your project via Jitpack.

repositories {
    mavenCentral()
    maven(url = "https://jitpack.io")
}

dependencies {
    implementation("com.github.caoimhebyrne:KDiscordIPC:0.2.2")
}

Example

val ipc = KDiscordIPC("YOUR_CLIENT_ID")

ipc.on<ReadyEvent> {
    logger.info("Ready! (${data.user.username}#${data.user.discriminator})")

    ipc.activityManager.setActivity("Hello", "world") {
        button("Click me", "https://google.com")
        timestamps(System.currentTimeMillis(), System.currentTimeMillis() + 50000)
    }

    // Want to get the information of another user? Sure thing!
    val user = ipc.userManager.getUser("USER_ID")
}

ipc.connect()

Maintainers

Caoimhe Byrne

License

MIT © 2023 Caoimhe Byrne

About

A Kotlin library for interacting with Discord via IPC

Topics

Resources

License

Stars

Watchers

Forks

Contributors 7

Languages