mirror of
https://github.com/opus-tango/minecraft-server-discord-bot.git
synced 2026-03-20 03:55:20 +00:00
fix no chat in mc
This commit is contained in:
2
bot.py
2
bot.py
@@ -288,7 +288,7 @@ async def send_message(message):
|
|||||||
await message.channel.send("No server is currently active.")
|
await message.channel.send("No server is currently active.")
|
||||||
return
|
return
|
||||||
minecraft_message = "[" + message.author.name + "] " + message.content
|
minecraft_message = "[" + message.author.name + "] " + message.content
|
||||||
process = subprocess.Popen(f"screen -S {active_server} -p 0 -X stuff '{minecraft_message}\n'", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
|
process = subprocess.Popen(f"screen -S {active_server} -p 0 -X stuff 'say {minecraft_message}\n'", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
|
||||||
stdout, stderr = process.communicate()
|
stdout, stderr = process.communicate()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user