Skip to content

NullDev/Arithmetica-Bot

Repository files navigation

Arithmetica-Bot

NullDev/DiscordJS-Template cd ESLint License GitHub closed issues

Discord Bot for counting. Allows arithmetic expressions.
https://arithmetica.xyz/


❓ What does it do?

Your average counting bot. Except you can count with arithmetic expressions!

Wiki: https://arithmetica.xyz/wiki


📡 Invite the bot

Invite

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 ⏬


⭐ Features

  • Set a counting channel via slash commands
  • Count normally (1, 2, 3, 4)
  • Count with arithmetic expressions (5^0, sqrt(4), i^2+4, log(10000, 10))
  • Slash commands
  • Arithmetic is toggleable
  • Toggleable Math-Only mode (counting only using arithmetic expressions)
  • Cooldown for new server members
  • Timeout for losers
  • Timeout increment factor for every fail
  • Cheat-Mode (no losing)
  • /help command to get a list of all commands and useful information
  • /stats command for personal stats or the stats of another user
  • /global-stats command to see how other servers are doing (filter by current and all time best)
  • /best command to see the best count of the server so far
  • /top command for a leaderboard, sortable by counts or fails
  • /calc command to calculate arithmetic expressions (and see if they are a valid count)
  • /info command to get information about the bot and an invite link
  • /math-facts command to get a random math fact
  • /oeis command to look up a sequence on the OEIS
  • LaTeX Rendering engine /tex
  • Wolfram Alpha integration /ask
  • Code execution engine using /run
  • 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 ✅)
  • 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)
  • Easy to self-host
    • No external database needed
    • Easy configuration system
    • Install instructions provided below
  • Admin only commands
  • Prevent persons from counting multiple times in a row
  • Ban and unban users from counting
  • Handle counts deleted by the user
  • Sharding

💠 Feature requests & Issues

Feature request or discovered a bug? Please open an Issue here on GitHub.


🔒 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.xyz

TOS: https://arithmetica.xyz/tos/
Privacy: https://arithmetica.xyz/privacy/


🔧 Setup

  1. Open up your favourite terminal (and navigate somewhere you want to download the repository to).

  2. 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.

  3. 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.

  4. Install all dependencies by typing
    $ npm install

  5. Copy config/config.template.js and paste it as config/config.custom.js OR use npm run generate-config.

  6. Configure it in your favourite editor by editing config/config.custom.js.

  7. Start it in development mode by running
    $ npm start
    or start in production mode
    $ npm run start:prod


🔩 Configuration

Once the config has been copied like described in Step 4, 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. String N/A
discord:
dbl_token
OPTIONAL: DiscordBotList token to push commands and stats. String N/A
discord:
top_token
OPTIONAL: Top.gg token to push stats. String N/A
discord:
discords_list_token
OPTIONAL: Discords List token to push stats. String N/A
discord:
vote_webhook_secret
OPTIONAL: Secret for the vote webhook. String N/A

:octocat: Contributors

Made with contrib.rocks.