Replies: 2 comments
-
If Anyone is curious, here is the library I've started working on for discord interactions |
Beta Was this translation helpful? Give feedback.
0 replies
-
Probably not gonna be implemented in mark2. Will aim for chat bridge in mark3 whenever I get a chance to sit down and flesh that out more |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey All!
The maintainers of mark2 would like to ask for some feedback regarding the addition of a discord chat bridge to mark2.
As some of you who might write your own discord bots may have heard, discord.py has ceased development due to a plethora of reasons. Sadly, it was planned to use discord.py's upcoming
v2.0
update with its intent features as a way to have a low-overhead discord bot built-in to mark2. With the discontinuation of the development of discord.py, mark2 faces some new challenges if we are going to implement a feature like this.Slash commands
As you may have noticed, discord rolled out slash commands, and with them is a new way to implement user interactions with a discord application. Discord has introduced an outgoing webhook system to handle "interactions" which would make for an easy way to handle Discord -> mark2 communication. With this feature, the discord plugin for mark2 would work like the following:
/tellraw
message/say This is a message that would get sent to Minecraft chat
)I've already started work on a Python library that allows for Twisted Web Servers to be used with discord interaction webhooks. This new library would be added as a dependency to mark2 to reduce the amount of code needed for this to work in mark2.
Now, obviously, you can see this is a little inconvenient. It would be much better for mark2 to just handle all messages and send them, no need for silly commands! Sadly that way also comes with some Caveats...
Normal WebSocket-based discord bot
A Normal WebSocket based discord bot for mark2 would be extraordinarily easy to implement provided we work around a few design considerations. The main (and probably the most important) drawback for this method is the drastically higher overhead a WebSocket connection with discord would add. Discord WebSockets are notoriously spammy, a lot of data gets sent to them. Now, this is somewhat mitigated with the addition of discord intents, you can basically say to discord "Only send me these events" and the WebSocket will only get those events.
With this method, there is also another hurdle:
Discord.py is no longer developed. For long term support of a WebSocket-based discord bot (and one that would be compatible with twisted), we'd likely need to implement our own stripped-down version of a python discord WebSocket API. This is extremely time-consuming, and quite frankly out of the scope of what I'm willing to do for an application that I don't get paid to maintain.
Conclusion
In conclusion, you are the ones who will be using the feature the most. What do you think? Should we just stick with discord.py and hope that discord doesn't release some breaking change that destroys it? Should we go with a slash command system? Do you have any new recommendations for a discord bot library we could try (that doesn't have significant overhead)? Let us know!
Beta Was this translation helpful? Give feedback.
All reactions