16 lines
676 B
Kotlin
16 lines
676 B
Kotlin
package nl.voidcorp.ottobot.commands.`fun`
|
|
|
|
import nl.voidcorp.ottobot.command.Command
|
|
import nl.voidcorp.ottobot.command.CommandGroup
|
|
import nl.voidcorp.ottobot.command.CommandMessage
|
|
import nl.voidcorp.ottobot.command.CommandResult
|
|
import java.net.URI
|
|
|
|
object DogCommand : Command("dog", group = CommandGroup.FUN, allowAnywhere = true) {
|
|
override fun handle(event: CommandMessage): CommandResult {
|
|
val image = URI.create("https://random.dog/woof").toURL().readText()
|
|
val url = URI("https://random.dog/$image").toURL().openStream()
|
|
event.message.channel.sendFile(url, image).content("i is dog").queue()
|
|
return CommandResult.SUCCESS
|
|
}
|
|
} |