Jump to content

Custom Discord bot: Zomboi


Jonny

Recommended Posts

First of all sorry if this is the wrong place, mods feel free to move it!

 

The official discord integration I've found to be a bit buggy, and with it being hidden in the game there's no way to customise it, so I've created my own custom discord bot: Zomboi (I'm open to better name suggestions :D)

 

It's still very early in development , but I'm keen to see if it's useful for anybody else and if there are any features I can add

 

Current features:

- Mirror in-game chat to a discord channel, using username and avatar from matching discord user 

- Notifications when a player logs in, increases a perk level, or dies

- Get info about players, such as number of hours survived, total deaths, and perk levels

- Status displays current player count

- Get and set server options from discord

- Show map for last known player location

 

Future features:

- Mirror discord chat into game. Currently the only way I think this can be achieved is using the `servermsg` command, but it shows the message in big red text which isn't user friendly. Hoping future PZ versions will offer an alternative

- Server admin commands - Have done a proof of concept locally just working out the best way to structure the discord command(s)

- More flexibility linking discord and in-game users. Currently it relies on the usernames matching but probably need a command to "link" usernames that don't match

 

Welcome any feedback or questions, hopefully somebody else can get some use out of this

Edited by Jonny
Link to comment
Share on other sites

  • Jonny changed the title to Custom Discord bot: Zomboi

This is awesome! I'm going to try it out right now. Great job!

Edit: Sadly I can't use it, as my server is ran from a dedicated server provider service, not in my machine. I asked them if I could run the bot in the server's machine and they said no :(  Is there any way I could run it somehow if I don't own the server's machine? (I do have access to the server's logs, saves, and game folders)

 

Edited by Rayeloy
Link to comment
Share on other sites

Sorry to hear that :( Yeah there's probably not an easy way to solve it unless you can get real-time access to the logs as that's the only way things are exposed from the game, so the bot just watches the log files for new updates.


Does your dedicated server provider not offer you ssh access to the server?

Link to comment
Share on other sites

Got a proof of concept for showing a map of player locations which is a feature I wanted as I haven't found a nice way to share maps in-game, so now I can use the bot to find people I'm playing with. Tried to make it as close to the in-game map as possible :

spacer.png

Link to comment
Share on other sites

  • 2 weeks later...
On 3/12/2022 at 11:52 AM, Rayeloy said:

This is awesome! I'm going to try it out right now. Great job!

Edit: Sadly I can't use it, as my server is ran from a dedicated server provider service, not in my machine. I asked them if I could run the bot in the server's machine and they said no :(  Is there any way I could run it somehow if I don't own the server's machine? (I do have access to the server's logs, saves, and game folders)

 

So I moved my whole server to a dedicated server where I have SSH access. How do I install the bot now? git command gives me a denied access error. 

 

Link to comment
Share on other sites

  • 3 weeks later...

In kind of same sort of pickle like Rayeloy... Zomboi looks quite interesting and love to try this out, but I'm not particulary well-versed with python and code, how to install this? I might need some hand-holding. :D

Just download the .py & config files on some directory where my server on my linux box resides, and then change some directory variables in env configs and run the main .py file? Is that it? Trying it out today...

Link to comment
Share on other sites

Managed to get bot up and logged in on my server, but it seems to do nothing, any idea what might be wrong?

Ignoring exception in on_ready
Traceback (most recent call last):
  File "/home/pzserver/.local/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "zomboi.py", line 60, in on_ready
    if zomboi.channel is None:
AttributeError: 'Bot' object has no attribute 'channel'
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "users" is not found

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
  • 1 month later...
  • 2 months later...
  • 2 months later...
  • 1 month later...

the creator of this bot seems to check out once people start discussing. on any forum i see this bot being pushed he just goes silent shortly after posting and offers no help. to anyone reading this like i am months or years later down the road. you are on your own as far as setting this up unless someone comes along and offers an easy to follow guide in his stead he does not seem to be willing to do it. good luck, im stuck with the basic global chat feature because i dont want to learn python just to troubleshoot this bot for him.

Link to comment
Share on other sites

On 2/14/2023 at 2:38 AM, That One Friend said:

the creator of this bot seems to check out once people start discussing. on any forum i see this bot being pushed he just goes silent shortly after posting and offers no help. to anyone reading this like i am months or years later down the road. you are on your own as far as setting this up unless someone comes along and offers an easy to follow guide in his stead he does not seem to be willing to do it. good luck, im stuck with the basic global chat feature because i dont want to learn python just to troubleshoot this bot for him.

 

I've been in that exact same spot you  are in. I even reached out to him on reddit for assistance. I eventually fixed the issue. 
IF you need any help, maybe I can be of some assistance. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...