All Projects → kordlib → Kord

kordlib / Kord

Licence: mit
Idiomatic Kotlin Wrapper for The Discord API

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Kord

Discord Panel
📊 User friendly dashboard/tool for discord bot developpers to manage servers
Stars: ✭ 116 (-42.86%)
Mutual labels:  discord-api, discord
Discordcr
Minimalist Discord library for Crystal. (Still WIP, but usable)
Stars: ✭ 137 (-32.51%)
Mutual labels:  discord-api, discord
Arikawa
A Golang library and framework for the Discord API.
Stars: ✭ 123 (-39.41%)
Mutual labels:  discord-api, discord
Serenity
A Rust library for the Discord API.
Stars: ✭ 1,387 (+583.25%)
Mutual labels:  discord-api, discord
Sword
Discord library for Swift
Stars: ✭ 166 (-18.23%)
Mutual labels:  discord-api, discord
Discljord
A Clojure wrapper library for the Discord API, with full API coverage (except voice, for now), and high scalability
Stars: ✭ 111 (-45.32%)
Mutual labels:  discord-api, discord
Discord Haskell
Haskell library for writing Discord bots
Stars: ✭ 129 (-36.45%)
Mutual labels:  discord-api, discord
Discord.js Menu
💬 Easily create Discord.js v12 embed menus with reactions and unlimited customizable pages.
Stars: ✭ 89 (-56.16%)
Mutual labels:  discord-api, discord
Lenoxbot
🖥️ LenoxBot is a Discord bot that offers many cool new features to your Discord server!
Stars: ✭ 163 (-19.7%)
Mutual labels:  discord-api, discord
Discordgo
(Golang) Go bindings for Discord
Stars: ✭ 2,582 (+1171.92%)
Mutual labels:  discord-api, discord
Swiftdiscord
Discord API Client for Swift
Stars: ✭ 103 (-49.26%)
Mutual labels:  discord-api, discord
Discord Py Slash Command
A simple discord slash command handler for discord.py.
Stars: ✭ 183 (-9.85%)
Mutual labels:  discord-api, discord
Music Bot
Simple music bot with a full-blown queue system that is easy to understand
Stars: ✭ 102 (-49.75%)
Mutual labels:  discord-api, discord
Discordpp
A Modularized C++ Library for the Discord API
Stars: ✭ 111 (-45.32%)
Mutual labels:  discord-api, discord
Discord Rich Presence Tool
A C++/Qt program that lets you fill in your own custom Discord Rich Presence information for games and activities away from the PC.
Stars: ✭ 91 (-55.17%)
Mutual labels:  discord-api, discord
Discord.js
discord.js is a powerful Node.js module that allows you to easily interact with the Discord API.
Stars: ✭ 16,432 (+7994.58%)
Mutual labels:  discord-api, discord
Nino
🔨 Advanced and cute moderation discord bot as an entry of Discord's Hack Week!
Stars: ✭ 78 (-61.58%)
Mutual labels:  discord-api, discord
Client
A Typescript NodeJS library to interact with Discord's API, both Rest and Gateway.
Stars: ✭ 84 (-58.62%)
Mutual labels:  discord-api, discord
Discord.net
An unofficial .Net wrapper for the Discord API (http://discordapp.com)
Stars: ✭ 2,253 (+1009.85%)
Mutual labels:  discord-api, discord
Discordrpcmaker
Cross-platform Discord Rich Presence Maker, WITH BUTTONS!
Stars: ✭ 165 (-18.72%)
Mutual labels:  discord-api, discord

Kord

Discord Download Snapshot Github CI status (branch)

Kord is still in an experimental stage, as such we can't guarantee API stability between releases. While we'd love for you to try out our library, we don't recommend you use this in production just yet.

If you have any feedback, we'd love to hear it, hit us up on discord or write up an issue if you have any suggestions!

What is Kord

Kord is a coroutine-based, modularized implementation of the Discord API, written 100% in Kotlin.

Why use Kord

Kord was created as an answer to the frustrations of writing Discord bots with other JVM libraries, which either use thread-blocking code or verbose and scope restrictive reactive systems. We believe an API written from the ground up in Kotlin with coroutines can give you the best of both worlds: The conciseness of imperative code with the concurrency of reactive code.

Aside from coroutines, we also wanted to give the user full access to lower level APIs. Sometimes you have to do some unconventional things, and we want to allow you to do those in a safe and supported way.

Status of Kord

Right now Kord should provide a full mapping of the non-voice API. We're currently working on a testing library for easy bot testing against a semi mocked client as well as our own command system to facilitate more complex bot development.

Documentation

Installation

Replace {version} with the latest version number on maven central.

For Snapshots replace {version} with {branch}-SNAPSHOT

e.g: 0.7.x-SNAPSHOT

Download Snapshot

Gradle (groovy)

repositories {
    mavenCentral()
    // Kord Snapshots Repository (Optional):
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }

}
dependencies {
    implementation("dev.kord:kord-core:{version}")
}

Gradle (kotlin)

repositories {
    mavenCentral()
    // Kord Snapshots Repository (Optional):
    maven("https://oss.sonatype.org/content/repositories/snapshots")

}

dependencies {
    implementation("dev.kord:kord-core:{version}")
}

Maven

Kord Snapshots Repository (Optional):
<repository>
    <id>snapshots-repo</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    <releases>
        <enabled>false</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
</repository>

<dependency>
    <groupId>dev.kord</groupId>
    <artifactId>kord-core</artifactId>
    <version>{version}</version>
</dependency>

Modules

Core

A higher level API, combining rest and gateway, with additional (optional) caching. Unless you're writing your own abstractions, we'd recommend using this.

suspend fun main() {
    val client = Kord("your bot token")
    val pingPong = ReactionEmoji.Unicode("\uD83C\uDFD3")

    client.on<MessageCreateEvent> {
        if (message.content != "!ping") return@on

        val response = message.channel.createMessage("Pong!")
        response.addReaction(pingPong)

        delay(5000)
        message.delete()
        response.delete()
    }

    client.login()
}

Rest

A low level mapping of Discord's REST API. Requests follow Discord's rate limits.

suspend fun main() {
    val rest = RestClient("your bot token")

    rest.channel.createMessage("605212557522763787") {
        content = "Hello Kord!"

        embed {
            color = Color.BLUE
            description = "Hello embed!"
        }
    }

}

Gateway

A low level mapping of Discord's Gateway, which maintains the connection and rate limits commands.

suspend fun main() {
    val gateway = DefaultGateway()

    gateway.on<MessageCreate> {
        println("${message.author.username}: ${message.content}")
        val words = message.content.split(' ')
        when (words.firstOrNull()) {
            "!close" -> gateway.stop()
            "!detach" -> gateway.detach()
        }
    }.launchIn(gateway)

    gateway.start("your bot token")
}

FAQ

Will you support kotlin multi-platform

We will, there's an issue open to track the features we want/need to make a transition to MPP smooth.

Will you support voice

Yes, please check #101

When will you document your code

Yes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].