Minecraft-Console-Client
Minecraft-Console-Client copied to clipboard
Create DiscordRelay.cs
Message relaying ChatBot for Discord. (NOT Webhook)
Able to issue MCC command from Discord.

Require user to download two DLL libraries from https://github.com/ReinforceZwei/Minecraft-Console-Client/releases/tag/v0.0.1-beta before using this bot. The two libraries were written by me. Source code are not yet available publicly.
The current implementation is too incomplete. If anyone is interested in contributing, please leave a comment.
What's the difference between WebHook and Relay? Is Webhook for chat messages, and Relay for console commands?
FYI "Relay" is the function of the Chatbot. The method using behind is Discord API.
The differences are:
- Webhook is in single direction (MCC to DC) while Discord API is in both direction (MCC <-> DC)
- The functionality of webhook is very limited compare to Discord API
- Discord API is more difficult to use and implement
This is a really neat idea! I also had a bot integration in mind when creating the webhook script, due to its limitations. Unfortunately I had no idea on how to integrate the Discord API into this client, which limited me on sending messages to Discord via a webhook. I am really looking foreward to this project. :)
@ReinforceZwei I wanted to look into it, but I can neither find the .cs file in your mentioned repository, nor the .dll's for it. Am I understanding something wrong? o.O
@Daenges Sorry, I forgot to push the source code to GitHub. My bad https://github.com/ReinforceZwei/websocket-server https://github.com/ReinforceZwei/simple-discord-api
Hi, can you make a guide on how to use all this in discord, how to connect everything? I just don’t understand this
@iwixw Hi,
The Discord integration have not been done yet. There will be a guide available once this feature was completed.
@iwixw you may use DiscordWebhook.cs, until this project has finished.
@Daenges I do not understand how to use this, since I am a noob in scripts.
@iwixw Here is the bot manual. You basically need to download the file, put it in the same folder as the executable and do /script discordwebhook
@Daenges can I somehow send any commands to the server via discord?
@iwixw This is the point of this script here. The webhook can only send messages to discord and not the other way around.
@Daenges Can I add a webhook url link somewhere so that I don't have to type it into / dw changeurl [link] every time?
@iwixw this here is no room to ask general questions. If you have any further question, please open an issue and ask it there, so we can keep this thread related to the topic.
But to answer your question: This was already asked here.
Short answer is that there are two ways:
First: Hardcode it into the script. Just open the file with any text editor and put your link between the quotes here:
WebhookURL = "https://discord.com/api/webhooks/SomeNumber/RandomStuff"; // Enter your Webhook URL here to start the bot with it predefined.
Second: You just create a script as described in the issue.
For any further questions I am happy to help in the issue section. :D
hello is this done?
@AbdobiZark Nope. No further work was done here since the creation. I can still recommend DiscordWebhook.cs while waiting.
@AbdobiZark Nope. No further work was done here since the creation. I can still recommend DiscordWebhook.cs while waiting.
Can I use mccc command through discord or (discord to mccc) with this?
@AbdobiZark Nope, you can only stream chat messages from the server to your discord. (Back and forth communication is the purpose of this PR.)
@AbdobiZark Nope, you can only stream chat messages from the server to your discord. (Back and forth communication is the purpose of this PR.)
ahh i see a " chat log "
Since @breadbyte is working on porting this project to .NET 5, I think it is no longer necessary to implement our own Websocket server or Discord gateway API that works on old .NET Framework 4. We could just grab other Discord API implementation to make Discord integration works with MCC.
Since we're on .NET Core 6, you could use https://github.com/discord-net/Discord.Net
Seems like a nice library, tho everything would have to be in a Task.Run.