Coder Social home page Coder Social logo

blockbot's Introduction

BlockBot

A Minecraft - Discord chat linking mod

Minecraft Version Release Modrinth Downloads

Initial Configuration

Start the server to create a config file. Complete the config file (can be found in `config/blockbot-discord.toml) with the following relevant data (Bot token, Guild ID, chat channel ID)

[bot]
# Discord Bot token
token = ""
# Discord guild/server id
guild =

    # Channel IDs for the bot to use. Only the `chat` channel is required, others can be added or deleted
    [bot.channels]
    # Chat relay channel
    chat = 

A full list of options can be found in the configuration file.

License

BlockBot is available under the GNU LGPL v3.0 license. See LICENSE

blockbot's People

Contributors

drexhd avatar evilsquirrelguy avatar genau6502 avatar nocomment1105 avatar patbox avatar potatopresident avatar tom-the-geek avatar voidlighter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blockbot's Issues

[Feature request] Show skins set with mods like Fabrictailor

Unsure of how difficult this would be, but I have a server that uses Fabric Tailor and when players set a custom skin using it, the discord link doesn't update to use that skin, and uses the default skin for that player instead.
Not that big of an issue, and if it's not possible it's fine, but if there is any possibility of this happening it would be appreciated.

Messages produced by `/random roll` aren't relayed to Discord.

Is your feature request related to a problem?

Output messages produced from players who run /random roll don't get sent to Discord.
image

Describe the solution you'd like.

As the message is seen by all online players in-game, I would expect it to be relayed to Discord also.

Describe alternatives you've considered.

There is no alternative as I cannot control or detect what messages players send.

Agreements

  • I have searched for and ensured there isn't already an open issue regarding this.
  • I have ensured the feature I'm requesting isn't already in the latest supported mod version.

[Feature Request] Ability to link your Discord account to your Minecraft account

Linking can either be optional or required. If optional it's initiated by an in-game command, if non-optional, it's started on join.

When the user runs the command/gets kicked, they are sent a code (via command or kick message), which they can then DM to the Discord bot, linking their accounts. Among other things, this is more secure than a simple !whitelist command because players can only "whitelist" accounts that they have access to. It also avoids having to use the vanilla whitelist, which, as discussed in Discord, is cursed.

If forcing players to have linked accounts to join is on, this behaviour is disabled if the whitelist is enabled, so you can block people from joining even if their account is linked, and players on the whitelist don't have to have their account linked to join. This would be useful for quickly setting the server to staff-only while doing maintenance. There could also be an option to always let whitelisted players and/or ops through, even if the player is not linked.

Linked accounts get the following features (preferably configurable):

  • Players with linked accounts can get a role on Discord
  • Players can only join if they have a given role assigned (useful for a Twitch/Patreon server, for example, obviously only works if account linking is forced)
  • Players can only join if they are in a specific guild (or in one of a list of guilds)
  • Linked players can have their Discord nickname set to their Minecraft username
  • Roles on Discord can sync to a LuckPerms etc. permission group.
  • Minecraft Bans and Discord bans can sync.

[Feature request] Completely customisable messages in Discord

Similar to how DiscordSRV allows just about everything to be configured for the messages sent to Discord, BlockBot could support something similar.

My idea would be something like this:
Each message corresponds to some form of template file in the configuration directory (eg. config/blockbot-discord/messages/player_join.toml) that allows placeholders to be used (like the current beta config does) but also supports things like changing whether an embed is used or the username and avatar url of the webhook.

I'd be happy to implement something like this and open a pull request, but I thought it would be better to open an issue for discussion first.

Support for vanish mods

Is your feature request related to a problem?

In vanish, /playerlist and the count in the status field on discord still includes the player count including players in vanish.

image

Describe the solution you'd like.

Option in the API to provide a playerlist to allow vanish mods to remove such players from the display.

Describe alternatives you've considered.

N/A

Agreements

  • I have searched for and ensured there isn't already an open issue regarding this.
  • I have ensured the feature I'm requesting isn't already in the latest supported mod version.

Other

No response

Whitelist command doesnt appear to check for empty arguments.

When performing !whitelist without the necessary arguments, the bot will proceed to whitelist "whitelist".
Not sure if this could be from the way the bot processes the message.

however, a check to see if the message doesn't have any arguments and responding appropriately might be nice :D

likewise, has a !whitelist remove subcommand been considered?

either way, this is cool stuff. thanks for your hard work!

More Granular in-game Command Permissions/Customisable Commands

Maybe adding an option to allow certain roles to run a limited set of commands, as opposed to having full OP access (such as restricting it to /whitelist and /tp for example), or if this isn't viable, just adding discord slash commands that can be restricted to certain roles and which execute specific in-game commands. If you need any clarification lmk.

Tellraw Showing on Discord.

Tellraw showing on discord whenever someone gets something w/ a datapack (Paint's Completionist Datapack)
As Seen Here
So if there was a way to disable it id be happy

1.19 backport to 1.18.2

it seems 1.18.2 has not been getting love from block bot and missing a lot of updates that was made to 1.19's version. Can you please backport to 1.18.2? 1.18.2 is still widely used, more so than 1.19 if we look at the major modpacks that are still on 1.18.2 and not on 1.19

Option to restrict `/mc /playerlist /whitelist` to the chat channel.

On a discord server running multiple Minecraft servers and blockbots, it would be great to have an option to restrict all of the bot commands to the chat channel specified in the config.

There's no way, for example, to prevent people from using /whitelist in random channels.

And if we have two blockbots running, it might be a bit confusing if we ever need to /mc stop a server.

One drawback is that it would be awesome to be able to /mc ban across all servers with a command run only once, but we're used to doing it once per channel anyway.

BlockBot Increases CPU usage by about 10x on Beta 4

Generally, with no-one online, my server idles at about 10% (out of 200%). However, as soon as I add BlockBot, even just by itself, CPU usage spikes to 110% and stays there, while without it starts at 200%, then drops to 110% while it finishes starting up, then drops to 10% and stays. I can't see anything in the logs that would indicate anything amiss.

Feature request: the ability to use discord text styles and have it show up in game

Typing Text should result in a crossed out text in game, same with bold, etc.

Something should be done for the Spoilers text style, since Minecraft doesn't support anything similar to that. (Or any other styles Minecraft doesn't support that I am not aware of)

May be rejected because this lets you bypass the vanilla limitation of typing these types of text from in game, but still. I think that would be a welcome feature. Perhaps a config to disable that?

BlockBot doesn't come online; throws 403 Forbidden Missing Access null

I was trying to setup BlockBot but no matter what I do, it doesn't work and keeps throwing 403 Forbidden.
Bot token is correct, guild id is correct, channel id is correct, I have GUILD_MEMBERS intent, application.commands and administrator.
Build 2.0.0-beta
I don't know what to do. Can anyone help?

[22:11:16] [DefaultDispatcher-worker-1/ERROR]: Uncaught exception in thread "DefaultDispatcher-worker-1"
io.github.quiltservertools.blockbotdiscord.libs.dev.kord.rest.request.KtorRequestException: REST request returned an error: 403 Forbidden  Missing Access null
        at io.github.quiltservertools.blockbotdiscord.libs.dev.kord.rest.request.KtorRequestHandler.handle(KtorRequestHandler.kt:62) ~[blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.dev.kord.rest.request.KtorRequestHandler$handle$1.invokeSuspend(KtorRequestHandler.kt) ~[blockbot-discord-2.0.0-beta.jar:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [org_jetbrains_kotlin_kotlin-stdlib-1.6.10-cf953ebebc036e3.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93) [blockbot-discord-2.0.0-beta.jar:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) [org_jetbrains_kotlin_kotlin-stdlib-1.6.10-cf953ebebc036e3.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93) [blockbot-discord-2.0.0-beta.jar:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) [org_jetbrains_kotlin_kotlin-stdlib-1.6.10-cf953ebebc036e3.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93) [blockbot-discord-2.0.0-beta.jar:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) [org_jetbrains_kotlin_kotlin-stdlib-1.6.10-cf953ebebc036e3.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93) [blockbot-discord-2.0.0-beta.jar:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) [org_jetbrains_kotlin_kotlin-stdlib-1.6.10-cf953ebebc036e3.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15) [blockbot-discord-2.0.0-beta.jar:?]
        at io.github.quiltservertools.blockbotdiscord.libs.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93) [blockbot-discord-2.0.0-beta.jar:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) [org_jetbrains_kotlin_kotlin-stdlib-1.6.10-cf953ebebc036e3.jar:?]
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) [org_jetbrains_kotlinx_kotlinx-coe-jvm-1.5.2-83ec1384e22258cd.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) [org_jetbrains_kotlinx_kotlinx-coe-jvm-1.5.2-83ec1384e22258cd.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) [org_jetbrains_kotlinx_kotlinx-coe-jvm-1.5.2-83ec1384e22258cd.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) [org_jetbrains_kotlinx_kotlinx-coe-jvm-1.5.2-83ec1384e22258cd.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) [org_jetbrains_kotlinx_kotlinx-coe-jvm-1.5.2-83ec1384e22258cd.jar:?]

Restarting a server doesn't get logged in discord as "Server Stopped"

When using a server hosting service (I've tested on bisect hosting), restarting a server does not get logged as "Server Stopped". Only when the server starts again does it log "Server Started".

I pressed the restart button on the server control panel and restarts don't get logged.

[Feature Request] Add config option to ignore unknown application commands

If i use the same bot client with a different instance while the server is offline, and i want that to have it's own application commands, i can't, since BlockBot will remove them. (ik running multiple instances on the same bot is not good practice, but i don't want to clutter the discord server with bots :P )

A whitelist option for unknown commands could also do the trick.

Cannot setup blockbot on a server with minimal mods

So I'm setting up a new server using blockbot but when I try to start the server it hangs for a few seconds with an error finding a class and vomits out a massive stack trace about how main couldn't be found. Don't know if it's because one of the mods are incompatible but I installed blockbot with no issues about 6 months ago on a similar server with the same mods (they've been updated since then, though). Before installing blockbot the mods I installed were Carpet, CarpetExtra, Fabric Language Kotlin, Lithium, and Starlight. Here's a few snippets of the errors, I cropped out the rest because it's ridiculously long. Taking out blockbot starts up the server just fine.

Error loading class: net/minecraft/class_5455$class_5457 (java.lang.ClassNotFoundException: net/minecraft/class_5455$class_5457)

java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'blockbot-discord'! at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.lambda$invoke0$0(EntrypointUtils.java:51) ~[fabric-loader-0.13.3.jar:?] at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.13.3.jar:?] at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:49) ~[fabric-loader-0.13.3.jar:?] at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35) ~[fabric-loader-0.13.3.jar:?] at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:62) ~[fabric-loader-0.13.3.jar:?]

There's a few more errors, but I'm not sure if it's related to blockbot or just the other mods having issues running because of the previous errors. Can provide a full paste if more details are needed.

[Feature Request] Support for the chat channels from the Carbon chat mod

Is your feature request related to a problem?

Carbon is a great chat mod that has support to setup many different channels. The only issue with it is that it cancels the fabric chat event (I believe). This prevents discord mods like Blockbot from grabbing the messages.
Here is the link to the project. They have a API for the channels.
https://github.com/Hexaoxide/Carbon

Describe the solution you'd like.

Since Blockbot already somewhat has a channels feature, it would be amazing if it would have a (optional) integration with Carbon and thus have the ability to use the chat channels from it. This would be great for things like a staff chat channel linking to discord.

Describe alternatives you've considered.

I've tried almost all the other Discord mods, but none seems to have the features I want that Blockbot does have. (Like role assigning through linking). Same goes for Carbon, its such a nice chat mod to use.

Agreements

  • I have searched for and ensured there isn't already an open issue regarding this.
  • I have ensured the feature I'm requesting isn't already in the latest supported mod version.

Other

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.