You are browsing as a guest. Sign up (or log in) to start making projects!

CosmicBot

  • 5 Devlogs
  • 10 Total hours

A Slack Bot which can do many different things and games on the Hack Club Slack!

Ship #1 Changes requested

What did you make?
I built CosmicBot which is a space themed Slack Bot just like the theme of stardance. It has an asteroid mining clicker game (/cosmic-mine) where there is a real leaderboard and a game of Cosmic Hot Potato (/cosmic-bomb) which you can play with the whole server. It also has commands for trivia, latency testing, and random space jokes/cat facts. The bot is made using java script and is live on a nest server 24/7.

What was challenging?
The biggest challenges were making the in game memory and player loops. When I was making the asteroid game, I accidentally ran two of the same bot at the same time, causing scores to keep on changing in the wrong ways. Later when I was making the Hot Potato game there was a bug that didn’t let a new game start even on different servers.

What are you proud of?
I’m proud of just moving the Slack Bot from something someone can do alone to something you can do with your friends. Putting the whole thing on the nest was also a win for me because anyone can use it now as they want to. Overall, the game feels like it was coded correctly, is responsive, and fun to play with a group.

What should people know so they can test your project?
To test it out you have to hop on to the Hack Club slack and then install the bot to the channel if it doesn’t work when you first try it. To see all the commands just type /cosmic-help.

Try project → See source code →
Open comments for this post

5h 6m 57s logged

Cosmic Hot Potato is working now and it’s basically a game where you play hot potato with people on any server you want to by typing /cosmic-bomb. This game could basically go on forever and I feel like it would be fun to play with some friends.
So I feel like I am pretty much done with the bot because I have worked on it for a good amount of time and I am going to ship it soon then.

Cosmic Hot Potato is working now and it’s basically a game where you play hot potato with people on any server you want to by typing /cosmic-bomb. This game could basically go on forever and I feel like it would be fun to play with some friends.
So I feel like I am pretty much done with the bot because I have worked on it for a good amount of time and I am going to ship it soon then.

Replying to @Harsh_S

1
52
Open comments for this post

1h 24m 28s logged

Ok so this time I added a clicker competition game on the bot which many people can compete in. You just do /cosmic-mine in slack and you start the game. It’s basically behind the theme of mining asteroids for stardust, get it?
The main thing that went wrong with this was the score kept on stacking. So I added code that reset the counter back to zero every time a new game started
It works perfectly now and you can actually compete for stardust without the scoreboard breaking. Looking pretty good ngl. Going to add new things soon.

Ok so this time I added a clicker competition game on the bot which many people can compete in. You just do /cosmic-mine in slack and you start the game. It’s basically behind the theme of mining asteroids for stardust, get it?
The main thing that went wrong with this was the score kept on stacking. So I added code that reset the counter back to zero every time a new game started
It works perfectly now and you can actually compete for stardust without the scoreboard breaking. Looking pretty good ngl. Going to add new things soon.

Replying to @Harsh_S

1
30
Open comments for this post

2h 14m 56s logged

I just finished making my slack bot trivia game. Getting the commands to work with the chat answers took way too long, but I finally got it to run a game without something going wrong.

The main thing that went wrong was the The Annoying 3-Second Timeout Whenever I typed /cosmic-trivia, Slack would instantly stop and say the app didn’t respond. This happened because Slack has a 3-second limit, and my bot was taking too long to send back the text.

What I fixed: I changed the code so the message sends exactly at the same time the bot connects to slack and the time you send the command.

I just finished making my slack bot trivia game. Getting the commands to work with the chat answers took way too long, but I finally got it to run a game without something going wrong.

The main thing that went wrong was the The Annoying 3-Second Timeout Whenever I typed /cosmic-trivia, Slack would instantly stop and say the app didn’t respond. This happened because Slack has a 3-second limit, and my bot was taking too long to send back the text.

What I fixed: I changed the code so the message sends exactly at the same time the bot connects to slack and the time you send the command.

Replying to @Harsh_S

1
34
Open comments for this post

57m 24s logged

After last time a few new commands were added and the bot was moved to a 24/7 server so it can be used whenever someone wants to.

  1. Some of the new commands are:
    /cosmic-joke - tells a random joke
    /cosmic-catfact - gives a random fact about a cat
    /cosmic-help - Lists the available commands

  2. So there were a few problems that I had to get past
    The git repository wasn’t found, which is solved directly on github. Sometimes the terminals just froze or wouldn’t read the text which I solved through smaller commands or restarting the whole thing. Also I had to debug the code for a little while as the slack commands were not working properly.

  3. Moving the Bot to nest
    To make sure the bot stays online even when my computer is closed I cloned and moved the file to a nest server and I also put the.env file on the server to make sure the bot works.

After last time a few new commands were added and the bot was moved to a 24/7 server so it can be used whenever someone wants to.

  1. Some of the new commands are:
    /cosmic-joke - tells a random joke
    /cosmic-catfact - gives a random fact about a cat
    /cosmic-help - Lists the available commands

  2. So there were a few problems that I had to get past
    The git repository wasn’t found, which is solved directly on github. Sometimes the terminals just froze or wouldn’t read the text which I solved through smaller commands or restarting the whole thing. Also I had to debug the code for a little while as the slack commands were not working properly.

  3. Moving the Bot to nest
    To make sure the bot stays online even when my computer is closed I cloned and moved the file to a nest server and I also put the.env file on the server to make sure the bot works.

Replying to @Harsh_S

1
23
Open comments for this post

25m 27s logged

CosmicBot is officially working now, the first bot I’ve made and it’s working so far so well.

I started building the Slack bot using Node.js/javascript and the slack system.

Quick Overview of what I did so far
Used socket mode to work the bot in real time and put the password tokens in a protected place called the .env file
Made my first working command that worked pretty much instantly
I plan on making something no other bot has

CosmicBot is officially working now, the first bot I’ve made and it’s working so far so well.

I started building the Slack bot using Node.js/javascript and the slack system.

Quick Overview of what I did so far
Used socket mode to work the bot in real time and put the password tokens in a protected place called the .env file
Made my first working command that worked pretty much instantly
I plan on making something no other bot has

Replying to @Harsh_S

1
31

Followers

Loading…