Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Chris Smith ca4397505b More debugging, add weird networking info to README il y a 5 ans
gradle/wrapper Upgrade to Gradle 5.1.1, fix new deprecations il y a 5 ans
src More debugging, add weird networking info to README il y a 5 ans
.gitignore Make gradlew executable il y a 5 ans
.travis.yml Deploy to bintray on tags il y a 5 ans
CHANGELOG More debugging, add weird networking info to README il y a 5 ans
LICENCE Licence il y a 5 ans
README.md More debugging, add weird networking info to README il y a 5 ans
build.gradle.kts 0.2.1 (mainly to test travis) il y a 5 ans
gradlew Make gradlew executable il y a 5 ans
gradlew.bat Initial import, various supporting classes. il y a 5 ans

README.md

KtIrc

Build Status Codacy Badge codecov Download

KtIrc is a Kotlin JVM library for connecting to and interacting with IRC servers. It is still in an early stage of development.

Setup

KtIrc is published to JCenter, so adding it to a gradle build is as simple as:

repositories {
    jcenter()
}

dependencies {
    implementation("com.dmdirc:ktirc:<VERSION>")
}

Usage

The main interface for interacting with KtIrc is the IrcClientImpl class. A simple bot might look like:

with(IrcClientImpl(Server("my.server.com", 6667), Profile("nick", "realName", "userName"))) {
    onEvent { event ->
        when (event) {
            is ServerWelcome -> sendJoin("#ktirc")
            is MessageReceived ->
                if (event.message == "!test")
                    reply(event, "Test successful!")
        }
    }
    connect()
}

Known issues / FAQ

java.lang.IllegalStateException: Check failed when connecting to some servers

This happens when the IRC server requests an optional client certificate (for use in SASL auth, usually). At present there is no support for client certificates in the networking library used by KtIrc. This is tracked upstream in ktor#641. There is no workaround other than using an insecure connection.

KtIrc connects over IPv4 even when host has IPv6

This is an issue with the Java standard library. You can change its behaviour by defining the system property java.net.preferIPv6Addresses to true, e.g. by running Java with -Djava.net.preferIPv6Addresses=true or calling System.setProperty("java.net.preferIPv6Addresses","true"); in code.

Contributing

Contributing is welcomed and encouraged! Please try to add unit tests for new features, and maintain a code style consistent with the existing code.

Licence

The code in this repository is released under the MIT licence. See the LICENCE file for more info.