Shimmermare / InviteRoles

A Discord bot to automatically give roles to users who joined through specific invite.
MIT License
18 stars 9 forks source link

Add Docker support #13

Open f0o opened 3 years ago

f0o commented 3 years ago

Based of Tag v1.0.1 this implements an alpine based Docker image using OpenJDK 16.

Sadly due to java being excessively bloated by nature the container is still 335MB in size. (321MB for the JDK Alpine image)

f0o commented 3 years ago

Beware of https://github.com/Shimmermare/InviteRoles/issues/12 as both master and 2.0 are not able to build functioning jars at the time of writing.

robhrt7 commented 3 years ago

@f0o thanks got the PR, I’m used the config to run the bot in Docker env. Do you run version 1.0.1 yourself? Can you confirm it works? My bot starts and is online on server but does not respond to commands and DB is not being created, I wonder if it’s this version issue or something to do with Docker env

robhrt7 commented 3 years ago

I think it's related to JDA and updated Discord API rules, rendering version 1.0.1 not functional anymore, see https://github.com/DV8FromTheWorld/JDA/issues/1424

f0o commented 3 years ago

yeah this project might as well just be dead. not sure I'm willing to fix it in Kotlin, rather recode it in golang or similar to be more efficient and smaller in size overall

robhrt7 commented 3 years ago

FIY, I've managed to patch v1.0.1 to make it work, see commit here in my fork https://github.com/GitNation/InviteRoles/commit/77c2e3ab1c751dcd760747874e11ac3660179210

f0o commented 3 years ago

Awesome thanks, added your patch to my backports branch haha

Guilhem-Pech commented 3 years ago

Hi ! Like the 1.0.1 version in the release doen't work I tried to build and run your version but it doesn't work (some errors with the environemental values) and I don't know how to fix them, can you build a -jar version ? or explain the steps I need to do in order to build my own on my computer ?

Guilhem-Pech commented 3 years ago

I have this error @operatino

[02:31:06.451][JDA MainWS-ReadThread][ERROR]: net.dv8tion.jda.api.JDA: One of the EventListeners had an uncaught exception
java.lang.IllegalStateException: No default locale: en_US
        at com.shimmermare.inviteroles.i18n.InternalizationService.getDefaultLocale(InternalizationService.kt:30)
        at com.shimmermare.inviteroles.i18n.InternalizationService.apply(InternalizationService.kt:47)
        at com.shimmermare.inviteroles.i18n.InternalizationService.apply(InternalizationService.kt:44)
        at com.shimmermare.inviteroles.command.AboutCommandProcessor.processAbout(AboutCommandProcessor.kt:25)
        at com.shimmermare.inviteroles.command.CommandService$registerCommands$1.invoke(CommandService.kt:154)
        at com.shimmermare.inviteroles.command.CommandService$registerCommands$1.invoke(CommandService.kt:28)
        at com.shimmermare.inviteroles.command.CommandService$sam$com_mojang_brigadier_Command$0.run(CommandService.kt)
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262)
        at com.shimmermare.inviteroles.command.CommandService.onGuildMessageReceived(CommandService.kt:82)
        at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:395)
        at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:64)
        at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:165)
        at net.dv8tion.jda.internal.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:97)
        at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:36)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:883)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:771)
        at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:750)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:921)
        at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
        at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
        at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
        at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
        at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
        at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
        at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)
robhrt7 commented 3 years ago

@Guilhem-Pech I'm not really a Java dev, so can't really assist...

I've managed to make my fork work, there are more issues related to new Discord API changes, see details here https://github.com/Shimmermare/InviteRoles/issues/15

Hope that helps