Activity

obob

Changelog

in this devlog, I moved my whole project to Docker, which allows me to deploy it much more easily and is just cleaner overall.

I started off with a basic dockerfile, and then iterated on it to fix some issues. One of the major issues I had was with pip, since I was running it as root and my actual program couldn’t access/find the modules at all, and I fixed this by chowning the /app directory and then switching to the user straight away before running pip.

Basically, I added a Docker file and docker-compose that uses my existing .env system and makes deployment much cleaner

Attachment
Attachment
Attachment
0
obob

I created a /ping command for my bot! The reason why there’s like 4 hours on this is because I had 3 or 4 revisions of this 😭.

Originally, I tried a method where my bot would post a message, then get the message timestamp from slack (basically a unix epoch, seconds since Jan 1, 1970), but this wasn’t accurate (results of like 1000ms, which is definitely not true) since, my system clock will never be perfectly synced with slack’s server.

Next, I tried to use python’s subprocesses module to run a ping command (like ping slack.com), like something you would do in the terminal and then use that result. However, Slack blocks ICMP (which is what ping uses), so this didn’t work either.

Finally, I tried a method where I created and closed a TCP port, and measured the time it took, which is surprisingly accurate. On top of this, I also added an API “ping” measurement, where I measured the time it took for a request to the Slack API to finish, which is wildly inaccurate lol (like 500ms of “ping”)

Attachment
0