nguyenquyhy / DiscordBridge

A Sponge plugin to integrate Minecraft server with a Discord channel
MIT License
31 stars 18 forks source link

Some logging messages not posting to log channel #51

Open BigJazzz opened 7 years ago

BigJazzz commented 7 years ago

Hey guys

When changing the logging channel, I get disconnect messages logged, however it doesn't appear to be logging connect and died messages. When they were in the same channel it all came through. Any suggestions as to what I've done wrong?


    "tokenStore": "JSON",
    "botToken": "[TOKEN]",
    "botDiscordGame": "Minecraft",
    "prefixBlacklist": ["/"],
    "ignoreBots": true,
    "minecraftBroadcastTemplate": "&c[Important] %s",
    "channels": [
        {
            "discordId": "[Chat Channel]",
            "discordInviteCode": "zbCks2a",
            "discord": {
                "publicChat": {
                    "authenticatedChatTemplate": "%s",
                    "anonymousChatTemplate": "`%a:` %s"
                },
                "broadcastTemplate": "__**[Important]**__ %s"
            },
            "minecraft": {
                "chatTemplate": "&f%a &f%s",
                "attachment": {
                    "template": "&3[Attachment]&r",
                    "hoverTemplate": "Please check Discord.",
                    "allowLink": false
                },
                "mention": {
                    "userTemplate": "@%s",
                    "roleTemplate": "@%s",
                    "everyoneTemplate": "&6@%s",
                    "channelTemplate": "&9#%s"
                },
                "roles": {
                    "Owner": {
                        "chatTemplate": "&f[&8+&cOwner&f] &c%a &f%s",
                        "attachment": {
                            "hoverTemplate": "Click to open attachment.",
                            "allowLink": true
                        }
                    },
                    "Admin": {
                        "chatTemplate": "&f[&8+&cAdmin&f] &c%a &f%s",
                        "attachment": {
                            "hoverTemplate": "Click to open attachment.",
                            "allowLink": true
                        }
                    },
                    "Global Mod": {
                        "chatTemplate": "&f[&a+&3Mod&f] &3%a &f%s",
                        "attachment": {
                            "hoverTemplate": "Click to open attachment.",
                            "allowLink": true
                        }
                    },
                    "FTB Mod": {
                        "chatTemplate": "&f[&9Modin&f] &9%a &f%s",
                        "attachment": {
                            "hoverTemplate": "Click to open attachment.",
                            "allowLink": true
                        }
                    },
                    "Supporter": {
                        "chatTemplate": "&f[&e+&dSupporter&f] &d%a &f%s",
                        "attachment": {
                            "hoverTemplate": "Click to open attachment.",
                            "allowLink": true
                        }
                    },
                    "Emerald": {
                        "chatTemplate": "&f[&e+&aEmerald&f] &a%a &f%s",
                        "attachment": {
                            "hoverTemplate": "Click to open attachment.",
                            "allowLink": true
                        }
                    },
                    "Donator": {
                        "chatTemplate": "&f[&bDonator&f] &b%a &f%s",
                        "attachment": {
                            "hoverTemplate": "Click to open attachment.",
                            "allowLink": true
                        }
                    },
                    "Member": {
                        "chatTemplate": "&f[&eMember&f] &e%a &f%s",
                        "attachment": {
                            "hoverTemplate": "Click to open attachment.",
                            "allowLink": true
                        }
                    }
                }
            }
        },
            {
                "discordId": "[Logging Channel]",
                "discord": {
                    "joinedTemplate": "_%s_ just joined the server.",
                    "leftTemplate": "_%s_ just left the server.",
                    "serverUpMessage": "Server has started.",
                    "serverDownMessage": "Server has stopped.",
                    "deathTemplate": "**%s**"
                }
            },
            {
                "discordId": "DISCORD_STAFF_BROADCAST_CHANNEL_ID",
                "minecraft": {
                    "chatTemplate": "&l&2<ANNOUNCEMENT> %s"
            }
        }
    ]
}```
BigJazzz commented 7 years ago

Scratch that, it's logging the join message (still can't see death), but it's logging it to the chat channel.

Mohron commented 7 years ago

@BigJazzz deaths were just recently added in my PR. They're not in any release.

BigJazzz commented 7 years ago

Ah, that explains that. Any suggestions on the joined messages posting to the wrong channel?

BigJazzz commented 7 years ago

@Mohron I think I've worked it out: when you have logged in with Discord it's reading it as a player message, not as a console message. Why it's reading dc messages correctly is beyond me, but player's who aren't logged in to Discord have both disconnect and connect messages going to the correct channel.

nguyenquyhy commented 7 years ago

I got that same problem when player join message shows only in the chat channel, and left message shows in both channel. However, after server restart, I cannot reproduce that problem any more. Does it happen the same to you?

Also, I am thinking if join/left message should be under player's account or bot account because player's account might not have access to the monitor channel. What do you think @BigJazzz ?

Mohron commented 7 years ago

I'd say server up/down messages should be handled by the bot even for authenticated users.

BigJazzz commented 7 years ago

Yeah, our logging channel is only accessible by staff. If the bot handled all "event" (up, down, join, left, etc) messages that would be good.