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 discord
This commit is contained in:
4
bot.py
4
bot.py
@@ -89,6 +89,7 @@ async def _read_from_pipe(servername, channel_id, bot_instance):
|
||||
if not channel:
|
||||
print(f"Error: Discord channel with ID {channel_id} not found.")
|
||||
return
|
||||
print(f"Sending to channel {channel_id}")
|
||||
|
||||
print(f"Attempting to open named pipe for reading: {pipe_path}")
|
||||
try:
|
||||
@@ -171,7 +172,8 @@ async def _read_from_pipe(servername, channel_id, bot_instance):
|
||||
# Limit message length for Discord if necessary
|
||||
if len(discord_message) > 2000:
|
||||
discord_message = discord_message[:1997] + "..."
|
||||
await channel.send(discord_message)
|
||||
print(discord_message)
|
||||
await bot.loop.create_task(channel.send(discord_message))
|
||||
# else:
|
||||
# # Optionally, you can log other server output to a debug channel or console
|
||||
# print(f"Non-chat output: {line}")
|
||||
|
||||
Reference in New Issue
Block a user