https://github.com/nulldev/arithmetica-bot
Discord Bot for counting. Allows arithmetic expressions.
https://github.com/nulldev/arithmetica-bot
arithmetic bot counting discord discord-bot discord-js nulldev
Last synced: 3 months ago
JSON representation
Discord Bot for counting. Allows arithmetic expressions.
- Host: GitHub
- URL: https://github.com/nulldev/arithmetica-bot
- Owner: NullDev
- License: agpl-3.0
- Created: 2023-05-17T03:00:35.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-03T11:38:11.000Z (3 months ago)
- Last Synced: 2025-04-03T12:32:21.108Z (3 months ago)
- Topics: arithmetic, bot, counting, discord, discord-bot, discord-js, nulldev
- Language: JavaScript
- Homepage: https://arithmetica.xyz/
- Size: 3.64 MB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Arithmetica-Bot
[](https://github.com/NullDev/DiscordJS-Template) [](https://github.com/NullDev/Arithmetica-Bot/actions/workflows/cd.yml) [](https://github.com/NullDev/Arithmetica-Bot/actions/workflows/eslint.yml) [](https://github.com/NullDev/Arithmetica-Bot/blob/master/LICENSE) [](https://github.com/NullDev/Arithmetica-Bot/issues?q=is%3Aissue+is%3Aclosed)
Discord Bot for counting. Allows arithmetic expressions.
https://arithmetica.xyz/
## :question: What does it do?
Your average counting bot. Except you can count with arithmetic expressions!
Wiki: https://arithmetica.xyz/wiki
## :satellite: Invite the bot
[](https://discordapp.com/oauth2/authorize?client_id=1108279646165942363&scope=bot&permissions=1100048526544)
The link above will invite a bot hosted by me that uses the latest version of this repo.
Alternatively you can host the bot yourself. Instructions [below ⏬](#wrench-setup)
## :star: Features
- [x] Set a counting channel via slash commands
- [x] Count normally (`1, 2, 3, 4`)
- [x] Count with arithmetic expressions (`5^0, sqrt(4), i^2+4, log(10000, 10)`)
- [x] Slash commands
- [x] Arithmetic is toggleable
- [x] Toggleable Math-Only mode (counting only using arithmetic expressions)
- [x] Cooldown for new server members
- [x] Timeout for losers
- [x] Timeout increment factor for every fail
- [x] Timed role for losers
- [x] Cheat-Mode (no losing)
- [x] `/help` command to get a list of all commands and useful information
- [x] `/stats` command for personal stats or the stats of another user
- [x] `/global-stats` command to see how other servers are doing (filter by current and all time best)
- [x] `/best` command to see the best count of the server so far
- [x] `/top` command for a leaderboard, sortable by counts or fails
- [x] `/calc` command to calculate arithmetic expressions (and see if they are a valid count)
- [x] `/info` command to get information about the bot and an invite link
- [x] `/math-facts` command to get a random math fact
- [x] `/oeis` command to look up a sequence on the [OEIS](https://oeis.org/)
- [x] LaTeX Rendering engine `/tex`
- [x] Wolfram Alpha integration `/ask`
- [x] Code execution engine using `/run`
- [x] Multi-language support (Can be set on every Discord server individually)
- English (Peer reviewed ✅)
- German (Peer reviewed ✅)
- French (Peer reviewed ✅)
- Spanish (Peer reviewed ✅)
- Russian (Peer reviewed ✅)
- Japanese (Peer reviewed ✅)
- [x] Easy to set up (view `/admin-help`)
- Set the channel and you're good to go (`/set-channel`)
- Optionally, set server language (`/set-language`) (Default: English)
- Optionally, disable/enable/force the use of arithmetic (`/toggle-arithmetic`) (Default: Enabled)
- Optionally. set a timeout for losers (`/set-timeout`) (Default: Disabled)
- Optionally, set a cooldown for new server members (`/cooldown`) (Default: 60 minutes)
- Optionally, set a timeout increment factor (`/timeout-increment`) (Default: Disabled)
- Optionally, enable cheat mode (`/cheat-mode`) (Default: Disabled)
- Optionally, set a loser role (`/set-loser-role`) (Default: None)
- Optionally, set the last count e.g. if you migrate from another bot (`/set-last-count`) (Default: 0)
- [x] Easy to self-host
- No external database needed
- Easy configuration system
- Install instructions provided [below](#wrench-setup)
- [x] Admin only commands
- [x] Prevent persons from counting multiple times in a row
- [x] Ban and unban users from counting
- [x] Handle counts deleted by the user
- [x] Sharding
## :diamond_shape_with_a_dot_inside: Feature requests & Issues
Feature request or discovered a bug? Please [open an Issue](https://github.com/NullDev/Arithmetica-Bot/issues/new/choose) here on GitHub.
## :lock: Permissions
The bot requires the following permissions:
- Send Messages: To send messages in the counting channel
- Manage Messages: To delete messages in the counting channel
- Read Messages/View Channels: To read messages in the counting channel
- Add Reactions: To add reactions to messages in the counting channel
- Embed Links: To send embeds
- Moderate Members: To timeout users when a timeout is set for losers
- Manage Webhooks: To create webhooks for users when a message is deleted in the counting channel
- View Audit Log: To see who invited the bot in order to send them a setup guide
- Manage Channels: To create a counting channel if it doesn't exist yet
## 🤖 DBL & Top.gg
## 🌐 Website & Repo
Website: https://arithmetica.xyz
Repository: https://github.com/NullDev/arithmetica.xyzTOS: https://arithmetica.xyz/tos/
Privacy: https://arithmetica.xyz/privacy/
## :wrench: Setup
0. Open up your favourite terminal (and navigate somewhere you want to download the repository to).
1. Make sure you have NodeJS installed (>= v20.0.0). Test by entering
$ `node -v`
If this returns a version number, NodeJS is installed. **If not**, get NodeJS here.
2. Clone the repository and navigate to it. If you have Git installed, type
$ `git clone https://github.com/NullDev/Arithmetica-Bot.git && cd Arithmetica-Bot`
If not, download it here and extract the ZIP file.
Then navigate to the folder.
3. Install all dependencies by typing
$ `npm install`
4. Copy [config/config.template.js](https://github.com/NullDev/Arithmetica-Bot/blob/master/config/config.template.js) and paste it as `config/config.custom.js` OR use `npm run generate-config`.
5. Configure it in your favourite editor by editing `config/config.custom.js`.
6. [LINUX ONLY]: Install LaTeX dependencies:
$ `sudo ./setup_latex.sh`
7. Start it in development mode by running
$ `npm start`
or start in production mode
$ `npm run start:prod`
or (recommended), use PM2
$ `pm2 start pm2.ecosystem.json`
## :nut_and_bolt: Configuration
Once the config has been copied like described in [Step 4](#wrench-setup), it can be changed to your needs:
| Config Key | Description | Data Type | Default value |
| ---------- | --------- | ------------------ | ------------ |
| discord:
`bot_token` | Auth Token of the Discord bot. Can be created [here](https://discordapp.com/developers/). | String | N/A |
| discord:
`dbl_token` | OPTIONAL: [DiscordBotList](https://discordbotlist.com/) token to push commands and stats. | String | N/A |
| discord:
`top_token` | OPTIONAL: [Top.gg](https://top.gg/) token to push stats. | String | N/A |
| discord:
`discords_list_token` | OPTIONAL: [Discords List](https://discords.com/) token to push stats. | String | N/A |
| discord:
`botlist_token` | OPTIONAL: Botlist token to push stats. | String | N/A |
| discord:
`dlist_token` | OPTIONAL: Dlist token to push stats. | String | N/A |
| discord:
`vote_webhook_secret` | OPTIONAL: Secret for the vote webhook. | String | N/A |
| discord:
`wolfram_appid` | OPTIONAL: Secret for the Wolfram-Aplha API. | String | N/A |
| discord:
`bot_owner_ids` | OPTIONAL: Discord IDs of Bot owners | String-Array | [] |
| discord:
`total_shards` | Total shard count | number , "auto" , undefined | "auto" |
| http:
`port` | Port for fastify vote route | number | 1335 |
## :octocat: Contributors
Made with [contrib.rocks](https://contrib.rocks).