Open Deide opened 5 days ago
Thank you for your report this is definitely a bug and I'll fix it very soon (likely tomorrow).
As for /general
instead of /all
, I forgot I made that change when I wrote the description. However, after thinking about it, I agree it would be best to keep the /all
command as most player will be expecting it. I'll see if I can keep both /general
and /all
.
I identified the bug when typing in general chat and fixed it.
/general
is back to being /all
.
Nice! The second error is completely gone, but the first one remains (there is still no Discord -> Zomboid communication despite seeing it in the server console).
Client console:
[TICS] TICS error: failed to remove discord message prefix for message: "Message from Discord"
Server console:
LOG : Network> DISCORD: send message = "Message from Discord" for deide)
LOG : General> Message 'ChatMessage{chat=General, author='deide', text='Message from Discord'}' was sent to player with id '0' of chat '0'
LOG : General> New message 'ChatMessage{chat=General, author='deide', text='Message from Discord'}' was sent members of chat '0'
@Phibonacci A friendly ping just in case you didn't see this.
Indeed I missed it. I'll try to reproduce it tomorrow.
If I remember correctly, when I tested it discord was always prefixing the message with an id. I'm removing this id before processing the message. I can easily make it optional but I would like to know what we did differently for your messages to be without that prefix.
I have no clue. Perhaps because I set the channel ID in the settings?
I cannot reproduce it, I never get that error message.
Do you send messages with @bot_name message
on Discord? As I understand it PZ bot is only sending messages prefixed by a HL. But maybe I'm wrong and you actually managed to send messages directly?
Aha, that was it. We've never had to mention the bot to get it working before. I tried mentioning it and it works just fine. I guess if you don't specify a channel, it needs to be mentioned?
I tested it by specifying both the channel and the channel ID and I never could make it work without a @bot. The wiki mentions:
Once configured, the Discord bot will post all messages from the in-game /all channel to the specified Discord channel. Any Discord messages that ping the Discord bot via @ or reply will be posted to the in-game /all channel.
I'm going to remove the error and make removing the prefix optional.
If you figure out what you did to make it work without a @ ping to the bot it would be appreciated by many servers I'm sure.
I have no clue. I don't recall doing anything special. Below are the only settings I changed, and it's been working all year.
# Enables global text chat integration with a Discord channel
DiscordEnable=true
# Discord bot access token
DiscordToken=<snip>
# The Discord channel name. (Try the separate channel ID option if having difficulties)
DiscordChannel=zomboid
# The Discord channel ID. (Use if having difficulties with Discord channel name option)
DiscordChannelID=<snip>
I was going to suggest that it has something to do with setting both the channel and channelID at the same time, but you even say that didn't work for you. Bizarre!
And I didn't do anything special with the bot, either. I gave it an avatar and changed its name.
I've enabled syncing with General in the sandbox settings. Before installing this mod, Discord integration worked (albeit with the duplication bug when the server was up for a certain amount of time).
I get this in the log when sending a message from Discord, and nothing turns up in game:
And when I send a message in
/general
in game, the message goes through to Discord, but the console records errors:This error is repeated dozens of times. Perhaps this is a work-in-progress feature? The mod page mentions it working with
/all
, but/all
is now disabled in favour of/general
.