Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

[RFC] Possibly new config #109

Open
MiraWaNeko opened this issue Oct 14, 2017 · 11 comments
Open

[RFC] Possibly new config #109

MiraWaNeko opened this issue Oct 14, 2017 · 11 comments

Comments

@MiraWaNeko
Copy link
Owner

MiraWaNeko commented Oct 14, 2017

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
Copy link

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
Copy link

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
Copy link
Owner Author

@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
Copy link

@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
Copy link
Owner Author

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

@DemonseedElite
Copy link

DemonseedElite commented Oct 19, 2017

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
Copy link

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

@DemonseedElite
Copy link

DemonseedElite commented Oct 19, 2017

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
Copy link

@DemonseedElite OMG IT WORKED THANKS!

@DemonseedElite
Copy link

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

@andrelec1
Copy link

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 ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants