hello there, i have made discord bot with kotlin a...
# announcements
a
hello there, i have made discord bot with kotlin and dialogflow , but i am comfused in how to deploy that project in heruku since it is kotlin dsl build script project in ? or i there any better alternative to heruku?
a
As a temporary solution you can build a fat jar, and run your app in heroku as a java project.
Copy code
plugins{
    id("com.github.johnrengelman.shadow") version "5.0.0"
}

tasks.named<ShadowJar>("shadowJar") {
    // Defaults to rootProjectDir/build/libs/${project.name}.jar
    // destinationDir = "/Custom/Directory/${rootProject.name}/${project.name}"
    manifest {
        attributes(mapOf("Main-Class" to "package.${MainFileName}Kt"))
    }
}
Hopefully in near future heroku would support kotlin-gradle scripts 🙂
a
ok leme test it
v
Actually Heroku is not suitable for a Discord bot due to many reasons. One of them is, that your bot will not be up 24/7 unless you give them your credit card number. Other issues being for example that their stuff is heavily underpowered and sometimes their ips get blocked due to abusers. But if all that doesn't bother you, go on with it. :-)
😮 2
If they only support Groovy build scripts you could probably make your root build script groovy and only apply a pre-compiled build script and do your logic in that pre-compiled build script which then is Kotlin
a
@Vampire so is there any better alternative to it for free, if please let me know
a
I don't think there's any free hosting service that gives you 24/7 uptime.
Maybe use raspberry pi for creating your own server (running under your own data connection).
v
You get what you pay for like usual. If you use a free service, you will always have some caveats or it wouldn't be free.
Google and Amazon cloud services also provide free tiers afair, but I don't know what their downsides will be
Just rent a cheap VPS or buy a Raspberry Pi if your bot is small enough for it
a
@Vampire and @Animesh Sahu I really appreciate your help 😊, I will take look(re-search) every point that you gave me and choose the right decision. THANKS edited: I think the microcontroller(raspberry pi 4) would work the best for my bot. I would choose it because I have full control to it, simple setup