palworld-server-docker icon indicating copy to clipboard operation
palworld-server-docker copied to clipboard

Toggle on off Discord messages

Open niah2209 opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. I don't like how it's spamming it every hour during backup and no way of turning it off, but I would like to keep the server updated messages.

Describe the solution you'd like Can we have a way to toggle on or off messages posted in Discord like backup messages?

Describe alternatives you've considered Right now I'm just altering the script within the docker container and commenting out that section that relates to sending messages for backup specifically.

Additional context image

niah2209 avatar Feb 08 '24 04:02 niah2209

Hi @niah2209, which messages would you like to turn on and off specifically? Some or all?

For any of the custom messages you can set the variable to be empty/null and it will not send it anymore.

For the backups, we can make "Creating backup..." a custom message variable, and put a flag to enable and disable the other ones. Reason why it can not be custom is because of the variables that would need to be expanded in the messages. I do not know of a way to do that.

v4de avatar Feb 08 '24 05:02 v4de

I only wanted to just turn off the backup messages really, but thought doing so would also enable having the ability to turn some on or off. I know that there are custom message variables in there, though it was strange that backup messages were not part of it. Because those restart messages don't happen that often, it's ok, but backup messages every hour is just too much. I have my scripts that do some of the custom messages myself, so would be nice to just turn off some so it doesn't do double duty etc.

niah2209 avatar Feb 08 '24 05:02 niah2209

Same issue here. An env var for enabling/disabling each discord message type would be great already, or perhaps a separate discord webhook var for each would solve two things. We can leave empty for any we wish to be disabled, and also specify different channels for different messages.

ayasuna avatar Feb 10 '24 16:02 ayasuna

@niah2209 @ayasuna I'm currently working on this enhancement, if you could, could you test this image? thijsvanloef/palworld-server-docker:pr-490

Variable Info Default Values Allowed Values
DISCORD_PRE_UPDATE_BOOT_MESSAGE Discord message sent when server begins updating Server is updating... "string"
DISCORD_PRE_UPDATE_BOOT_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_UPDATE_BOOT_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_POST_UPDATE_BOOT_MESSAGE Discord message sent when server completes updating Server update complete! "string"
DISCORD_POST_UPDATE_BOOT_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_POST_UPDATE_BOOT_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PRE_START_MESSAGE Discord message sent when server begins to start Server has been started! "string"
DISCORD_PRE_START_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_START_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PRE_SHUTDOWN_MESSAGE Discord message sent when server begins to shutdown Server is shutting down... "string"
DISCORD_PRE_SHUTDOWN_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_SHUTDOWN_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_POST_SHUTDOWN_MESSAGE Discord message sent when server has stopped Server is stopped! "string"
DISCORD_POST_SHUTDOWN_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_POST_SHUTDOWN_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PLAYER_JOIN_MESSAGE Discord message sent when player joins the server ${player_name} has joined Palworld! "string"
DISCORD_PLAYER_JOIN_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PLAYER_JOIN_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PLAYER_LEAVE_MESSAGE Discord message sent when player leaves the server ${player_name} has left Palworld. "string"
DISCORD_PLAYER_LEAVE_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PLAYER_LEAVE_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PRE_BACKUP_MESSAGE Discord message when starting to create a backup Creating backup... "string"
DISCORD_PRE_BACKUP_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_BACKUP_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_POST_BACKUP_MESSAGE Discord message when a backup has been made Backup created at ${FILE_PATH} "string"
DISCORD_POST_BACKUP_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_POST_BACKUP_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PRE_BACKUP_DELETE_MESSAGE Discord message when starting to remove older backups Removing backups older than ${OLD_BACKUP_DAYS} days "string"
DISCORD_PRE_BACKUP_DELETE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_BACKUP_DELETE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_POST_BACKUP_DELETE_MESSAGE Discord message when successfully removed older backups Removed backups older than ${OLD_BACKUP_DAYS} days "string"
DISCORD_POST_BACKUP_DELETE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_POST_BACKUP_DELETE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_ERR_BACKUP_DELETE_MESSAGE Discord message when there has been an error removing older backups Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=${OLD_BACKUP_DAYS} "string"
DISCORD_ERR_BACKUP_DELETE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_ERR_BACKUP_DELETE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL)

thijsvanloef avatar Mar 06 '24 09:03 thijsvanloef

Looks good so far

can leave running for a day to make sure

would suggest lower priority messages of player join, player leave to be disabled by default instead as usefulness vs volume of messages seems skewed.

ayasuna avatar Mar 06 '24 11:03 ayasuna

Right after saying this PRE_BACKUP_MESSAGE_ENABLED=false and POST_MESSAGE_BACKUP_ENABLED=false did not seem to have worked image image

ayasuna avatar Mar 06 '24 12:03 ayasuna

@ayasuna Thanks for testing! Could you pull the image again and try again? I just pushed some bugfixes

thijsvanloef avatar Mar 06 '24 12:03 thijsvanloef

If PRE_BACKUP_DELETE is enabled by default then it is not sending the message image

image

but the PRE_BACKUP_MESSAGE and POST_BACKUP_MESSAGE fix seemed to have worked

This is assuming the RCON backup command triggers the scripts.

I have not tested the PLAYER_JOIN and PLAYER_LEAVE at all FYI

ayasuna avatar Mar 06 '24 12:03 ayasuna

PRE_BACKUP_DELETE is only triggered when there is a backup to delete, so if you only have backups of today, it will not get triggered

thijsvanloef avatar Mar 06 '24 12:03 thijsvanloef

Seems to work here as well. For starting, can we also incorporate the version number using the rcon info as well in the Discord messages too?

niah2209 avatar Mar 06 '24 13:03 niah2209

I can do that, but for this PR this is out of scope.

thijsvanloef avatar Mar 06 '24 13:03 thijsvanloef