MiraWaNeko / DiscordIntegration

Communicate between Minecraft and Discord
https://discordintegration.net
GNU Affero General Public License v3.0
88 stars 41 forks source link

[RFC] Possibly new config #109

Open MiraWaNeko opened 6 years ago

MiraWaNeko commented 6 years ago

With so many people having issues with the new config I'm thinking if a rethinking of the config would be the best way to go?

I'm thinking of a setup where you define the relays you want with from and to. That will remove the whole fallback logic, so the relays you define is the relays you get.

Maybe something along these lines

{
    "configure": {
        "generic": {
            "enableLink": true
        },
        "discord": {
            "token": "",
            "ignoreBot": true,
            "ignoreUser": [],
            "commandPrefix": "!",
            "enableCommand": true,
            "channels": {},
            "commands": []
        },
        "minecraft": {
            "serverStart": [],
            "serverStop": [],
            "serverCrash": [],
            "integrations": {
                "dynmap": {
                    "enable": true
                }
            }
        },
        "imc": {
            "enable": true,
            "mode": "whitelist",
            "list": []
        }
    },
    "relays": [
        {
            "type": "chat",
            "from": {
                "platform": "minecraft",
                "dimension": "*"
            },
            "to": {
                "platform": "discord",
                "channel": 1234567890
            },
            "format": "[{USER}] {MESSAGE}",
            "bidirectional": true
        },
        {
            "type": "command",
            "from": {
                "platform": "minecraft",
                "dimension": "*"
            },
            "to": {
                "platform": "discord",
                "channel": 1234567891
            },
            "format": "**{USER}** executed **{COMMAND} {ARGUMENTS}**",
        }
    ]
}
aaronhnsy commented 6 years ago

This is a good idea but maybe if you acctually updated the wiki with a bit more detail on where things go and such it would better... or you could make this website work better https://wip.discordintegration.net/config/generator

andrelec1 commented 6 years ago

good idea but "dimension" and "channel" need to be a array ... why "imc" is not in "configure" ?

in your exemple, le third "relays" element doesn't have "type", so what is its use ?

MiraWaNeko commented 6 years ago

@MyNameBeMrRandom The fact that I would need a generator probably shows that the current config layout just won't cut it.

@andrelec1 Would probably make it support both array and single value. Moved imc to configure Removed the third relays element, was left over when I was making examples.

aaronhnsy commented 6 years ago

@Chikachi Yes the only reason i use that config gen is because 1) Im a noob and 2) The Mods Wiki hasnt been updated

MiraWaNeko commented 6 years ago

@MyNameBeMrRandom Which settings do you see missing from https://wiki.discordintegration.net/Config-Explanation-v3 ?

DemonseedElite commented 6 years ago

The new Config is fine... I just think the Wiki needs more work. I'm a programmer, I understand JSONs... most people don't though. Granted, it took me a dozen attempts at editing it to get it to work. The Wiki is trying to explain ALL the config, ALL at once, on one page, and it's missing things. For example, the Wiki leaves the "channel" for the generic minecraft relay empty...
It should show something like: "discordChannel": [ "123456789101112134", // ID of a Discord channel, the bot should relay messages on ],

Make a SIMPLE example: -put token here- -put discord channel ID here for relaying everything- ...no commands, no customization, just simple 2-way communication, because that's how 95% of everyone uses this mod.

Then a second example adding onto the first example with some commands and permissions... Then how to relay to multiple Discord channels... Then maybe how to have different Minecraft dimensions relay to different channels or something...

OH!!! And run the examples through https://jsonlint.com/ ! Right now, if you copy-paste them and JUST remove the comments, they fail! This is what a lot of people are doing. There's a lot of hanging commas on the last elements.

aaronhnsy commented 6 years ago

That is what i meant ^^^ Theres nothing missing just need a bit more explaining for newbs like me

DemonseedElite commented 6 years ago

To help people out and because it took me a while to figure it out. Here is my config script. https://pastebin.com/3BvBJMnP Instructions are at the top of what to replace in it. It works how I want it to. Hopefully it'll give you guys a working exemplar to crib off of.
Here's another, more raw copy of it if you're still having issues: https://pastebin.com/J9cSCEFQ

aaronhnsy commented 6 years ago

@DemonseedElite OMG IT WORKED THANKS!

DemonseedElite commented 6 years ago

Glad my example was able to get you up and running finally MrRandom 😁

andrelec1 commented 6 years ago

I help some one else on discord, and i note the fact that people link their config without removing their discord token ... and i think this is a security issue !

maybe think to cut the config in two file, like "relays" in file and general + token in another ... so people juste links their "relais" file for asking help ...