'Multiple message content includes in one if statement?
im working on a really simple sorting discord bot, that just should sort message content from a Minecraft server console channel into sorted channels. Now im trying to find a way to make stuff more tidy...
client.on('message', msg=>{
if(msg.content.includes(`${client.botconfig.playername1} issued server command: /`)){
let channel = client.guilds.cache.get(client.botconfig.ServerID).channels.cache.get(client.botconfig.channelID1)
let usermsg = msg.content
channel.send(usermsg.replace("/",""))
}
})
Im using a config file to make it easier to change Channel ID's etc.
Now the Problem is, if the game console says: Player issued server command: / it doesnt recognize the Player Name provided by the config...
With the ` Symbol it doesnt even recognize it if the player name is written, but with other symbols like "" the $... doesnt work anymore.
Sorry for the bad description, I just hope somebody knows what i mean XD
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
