JonnyPtn / zomboi

A discord bot for project zomboid multiplayer servers
49 stars 32 forks source link

add ability to print a user's character name #43

Closed petegilb closed 1 year ago

petegilb commented 2 years ago

Made this a few weeks ago and it's been on my own instance for a while. Looks like this: image

I am doing a sleep in there because sometimes after a user creates a new character it doesn't update before the discord message is sent. This solves the problem most of the time, but sometimes it prints the name of their previous character. I suppose we can see if there's a way to wait for the sqlite transaction to complete somehow, but that is for the future. It works on user join and level up flawlessly.

Let me know if this doesn't seem like it's in the scope for this bot and I'll close the PR!

Thanks!

JonnyPtn commented 1 year ago

Looks good, thanks! I do wonder if it's worth having the 5 second sleep when getting the character name. I appreciate it fixes an issue but unsure if that's worth it for the extra latency in every other case. Perhaps there is another solution to this problem.

Currently I have nothing to suggest though so will merge and we can worry about it later if necessary