InnateAlpaca / BedrockBridge

BedrockBridge provides Bedrock Dedicated Servers with connection to discord for chat and commands
https://bedrockbridge.esploratori.space
MIT License
36 stars 4 forks source link

Discord bot problem #2

Closed ZanDev32 closed 1 year ago

ZanDev32 commented 1 year ago

The bot keep sending messages to the text channel on discord when user running command with custom prefix from other behavior pack. Example like when type +tpa (tpa is command for teleporting between player) the discord bot also send this to the text channel on discord

InnateAlpaca commented 1 year ago

Hello, we solved the issue on discord. Just answering here too for the others.

BedrockBridge can't know what prefixes are other packs using, hence will log all those messages. It is though possible to add an easy plugin that will block all messages starting with certain prefixes from being sent to discord.

Here an example of how this can be implemented. You can replace this inside BedrockBridge/options/customise.js. This will prevent messages starting with + or ! from being sent to discord!

const upStreamMessage = async (player, message)=>{
    if (!message.startsWith('+') && !message.startsWith('!'))
        return {
            author: player.nick,
            text: message
        }   
}