Skip to content

Latest commit

 

History

History
54 lines (43 loc) · 1.12 KB

README.md

File metadata and controls

54 lines (43 loc) · 1.12 KB

lib

kotlin library :)

How to use using Gradle.

repositories {
    ...
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.ajkneisl:lib:Tag'
}

webhooks

import dev.ajkneisl.lib.discord.DiscordWebhook
import kotlinx.coroutines.runBlocking

fun main() {
    runBlocking { 
        DiscordWebhook("webhook url").sendMessage("Hello! :)")
    }
}

ratelimit

webhooks automatically handle rate limit :)

if you want to change the log level of the rate limit notifications: (by default Level.TRACE)

import dev.ajkneisl.lib.discord.DiscordWebhook
import org.slf4j.event.Level

fun main() {
    DiscordWebhook.RATE_LIMIT_LOG_LEVEL = Level.TRACE
}

integrating with library

to make your webhook work with other functions of this library (ex: logging functions):

import dev.ajkneisl.lib.Lib
import dev.ajkneisl.lib.discord.DiscordWebhook

fun main() {
    val myWebhook = DiscordWebhook("webhook url")
    
    Lib.DEFAULT_WEBHOOK = myWebhook
}