A fun and interactive Slack bot that manages a collaborative counting game. Players take turns counting up, using simple numbers or complex mathematical expressions. The bot tracks stats, milestones, and user performance, encouraging friendly competition and mathematical creativity.
- Start counting from 1
- Support for complex mathematical expressions (addition, subtraction, multiplication, division, exponentiation, square roots, and cube roots)
- User stats tracking (successful counts, accuracy, average complexity)
- Milestones and achievements
This project is an actively maintained (so long as people use it...) fork of SlackCountingBot, which was developed as an experiment to test the capabilities of Cursor, an AI-powered coding assistant. However, this fork is independently maintained and includes significant changes to the game logic and features.
This project is a fork of the original SlackCountingBot, and there are several exciting reasons why I decided to fork it. Initially, the original bot was frustrating because it reset the counter every time someone made a mistake. To create a smoother, more enjoyable experience for everyone, I set out to change this.
In addition to addressing this issue, I took the opportunity to fix a few bugs present in the original bot. Improved error handling was another key focus—I made sure errors are sent directly to the Slack counting channel for better visibility and quicker resolution. This should make managing any issues that arise much easier.
Furthermore, I introduced a new Slack slash command, /counting-eval
, expanding the bot's functionality and giving users more options when evaluating math expressions. This addition allows for even more interactive and engaging experiences.
To enhance user experience, I also made a few changes to ensure that when any user requests the leaderboard or other things, it is only visible to them, avoiding unnecessary mass pings and keeping notifications more manageable.
Lastly, and perhaps most excitingly, I added support for cube roots (cbrt()
) and enhanced the complexity calculator. These changes make the game more fun and challenging, providing a better overall experience for users.
Overall, these improvements aim to make the bot more user-friendly, versatile, and enjoyable to interact with. I hope you find these enhancements as exciting and useful as I do! If you have any feedback or additional ideas, I'm all ears—let's keep making this project even better together.
To set up and run the Slack Counting Game Bot, follow these steps:
-
Clone this repository:
git clone https://github.com/QinCai-rui/SlackCountingBot.git cd SlackCountingBot
-
Install dependencies:
bun install
-
Create a Slack App:
- Go to Slack API Apps and create a new app
- Add the necessary bot scopes (e.g.,
chat:write
,reactions:write
) - Install the app to your workspace
-
Set up environment variables:
-
Create a
.env
file in the project root -
Add the following variables:
SLACK_BOT_TOKEN=xoxb-your-bot-token SLACK_SIGNING_SECRET=your-signing-secret COUNTING_GAME_CHANNEL_ID=channel-id
-
-
Start the bot:
bun app.js
-
Invite the bot to your designated counting channel in Slack.
-
Start counting!
- No Bots: Only humans can play!
- One Number at a Time: Each person can only count once in a row.
- Continuity: If someone makes a mistake, the count continues without resetting.
- Mathematical Expressions: Users can use basic and complex mathematical operations to represent numbers (e.g.,
2+3
,sqrt(36)
,2^3
,cbrt(27)
).
/counting-help
or!help
: Shows the rules and commands for the game./counting-stats
or!stats
: Displays current game statistics, such as highest count, total counts, and top counters./counting-eval [expression]
: Evaluates a mathematical expression privately.
We welcome contributions to this project! If you have any ideas or suggestions, please open an issue or submit a pull request.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
This license ensures that the software remains free and open-source. It allows you to use, modify, and distribute the code, but any modifications or larger works based on this project must also be released under the same license.