howyi / MCSlackIntegration

open-source Slack bridge plugin for minecraft server
https://howyi.github.io/MCSlackIntegration/
3 stars 0 forks source link

Slack message cannot be forwarded to Minecraft server #8

Open herobrinein opened 1 year ago

herobrinein commented 1 year ago

When I tested sending messages to the Minecraft server in the slot, I found that the server did not receive any messages and the console did not report any errors.

Here is my configuration:

Message:

slack post message on server start

※Do not post if empty

ServerStart: "服务器已启动"

slack post message on server end

※Do not post if empty

ServerEnd: "服务器已关闭"

slack post message on player join

※Do not post if empty

{0}: joined player name

ex. hoyash

PlayerJoin: "{0} 加入了游戏"

slack post message on player leave

※Do not post if empty

{0}: left player name

ex. hoyash

PlayerQuit: "{0} 退出了游戏"

slack post message on player dead

※Do not post if empty

{0}: death message

ex. hoyash was shot by Skeleton

PlayerDeath: "{0}"

slack post message on player chat

※Do not post if empty

{0}: minecraft player chat text

ec: hello

PlayerChat: "{0}"

slack post username on player chat

{0}: minecraft player name

ec: hello

PlayerChatName: "{0}"

Format for chatting posts on connected slack channels to minecraft

※Do not post if empty

{0}: Slack username

ex. t-hayashi

{1}: Slack post text

ex: hello from slack

FromSlackChat: "Slack#{0}:{1}"

herobrinein commented 1 year ago

Can you add a custom prefix like '#' to forward to Minecraft server or slack?Forward all messages when the current prefix is empty

howyi commented 1 year ago

@herobrinein Are you saying that only the "Slack -> minecraft chat sync" is not working? I used the config you wrote and it worked, so the problem could be as follows... 🤔

SlackSocketToken is incorrect.

The socket connection token you have set up may not be in a form that allows you to receive chat notifications. Check the following page, reconfigure it, and try restarting https://howyi.github.io/MCSlackIntegration/slack_app/#get-app-level-token

WebSocket is not establishing a connection to Slack

The connection from the server to Slack may not be working. If so, you may be getting a WARN log on startup. If it started correctly, you will see the following log.

[14:10:07] [Server thread/INFO]: [SlackIntegration] Enabling SlackIntegration v0.0
[14:10:10] [Grizzly(2)/INFO]: New session is open (session id: 55763c14-0597-438f-b1e7-f8e4d4565164)
herobrinein commented 1 year ago

I reconfigured App Level Tokens and it popped up [16:33:19 INFO]: [SlackIntegration] Enabling SlackIntegration v1.0.0 [16:33:27 INFO]: [com. stack. api. sockets mode. sockets ModeClient] New session is open (session id: 858570df-5d70-4f01-898d-b79611633b02) But the server did not receive the message

herobrinein commented 1 year ago

token name The token name is a socket and has been granted the following permissions: Scope Connections: write Route your app's interactions and event payloads over WebSockets App_ Configurations: write Configure your application Authorizations: read

howyi commented 1 year ago

@herobrinein Thanks for details 🐔

herobrinein commented 1 year ago

We have invited a public and connected channel that can accept player messages, death messages, and access to the game from the server. The server core is purpur-1.20.1-2011, plugin version is 1.0.0.

herobrinein commented 1 year ago

When I shut down the server, the plugin showed the following message: [21:01:51 INFO]: [com.slack.api.socket_mode.SocketModeClient] onClose listener is called (session id: 24c4c112-a7a9-4600-804a-862c477845b7, reason: com.slack.api.socket_mode.impl.SocketModeClientTyrusImpl did it) [21:01:51 WARN]: [com.slack.api.socket_mode.SocketModeClient] Failed to send a ping message (session id: 24c4c112-a7a9-4600-804a-862c477845b7, error: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@463f4d65[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@235871e7[Wrapped task = org.glassfish.tyrus.core.TyrusSession$IdleTimeoutCommand@4a2cd68a]] rejected from java.util.concurrent.ScheduledThreadPoolExecutor@36431956[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 4157]) [21:01:51 INFO]: [com.slack.api.socket_mode.SocketModeClient] The current session is no longer active. Going to reconnect to the Socket Mode server.

howyi commented 1 year ago

@herobrinein Thank you. I have tested it on purpur-1.20.1-2011 and it works fine 🥺. By the way, is the Home of SlackApp working properly? (This one also uses WebSockets, so that might give you some hints)

herobrinein commented 1 year ago

It is currently working, will the plugin support bundle record in the future?

howyi commented 1 year ago

@herobrinein What is a bundle record?

herobrinein commented 1 year ago

oh, bungeecord

herobrinein commented 1 year ago

I'm still not sure where the problem is, even if I followed the tutorial completely and did it again

howyi commented 1 year ago

BungeeCord support issue: https://github.com/howyi/MCSlackIntegration/issues/12

herobrinein commented 1 year ago

🤔I have created a new workspace and created a bot again according to the tutorial. Can I see the messages sent by Slack to the game on Chatcraft?

howyi commented 1 year ago

@herobrinein Did the plugin work correctly after reinstallation?

I have never heard of ChatCraft. Is it an app? 🤔 I could not confirm that it works as there is no version support for 1.20 at this time.

herobrinein commented 1 year ago

The plugin is working properly, and I'm not sure if I can see messages through the navigation. Chatcraft is equivalent to minecraft without a game interface The game version used is 1.19.2