Skip to content

ChatCounting is a bot designed to keep track of counting from one to infinity in a specific channel on your Discord server.

License

Notifications You must be signed in to change notification settings

RillJ/ChadCounting

Repository files navigation

ChadCounting

Say goodbye to ruined counts with ChadCounting, the bot that never misses a count. Count as high as you can and become the ultimate gigachad.

ChadCounting is a Discord bot that makes it easy for users on a server to collaborate on counting. With an emphasis on accuracy and reliability, ChadCounting is the ideal choice for gigachads who want to push their skills to the limit. In contrast to other counting bots, ChatCounting is specifically optimized to prevent incorrect counting on the bots side, making it the perfect tool for your server's counting needs.

As an avid user of counting bots myself, one of the main issues I've encountered with other counting bots is that they had difficulty counting themselves. Most of the time, when the count was ruined, it was not because of our inability to count like chads, but the counting bot's inability to keep up with our chadness. For example, the counting bot went offline, didn't count our counts, then when it came back online it told us we've ruined the count and should start over. Or the bot ignored our correct count, we counted the number again, and it told us we can't count twice in a row. Frustrating for highly-capable counting chads. That's why I've developed ChadCounting.

One of the distinctive features of ChadCounting is the catch-up feature. In case ChadCounting or Discord is offline for a bit (e.g. due to maintenance), the bot catches up to missed counts and lets you know that it did so. This means that when ChadCounting didn't respond with an emoji to your message, you can still continue counting, because you can have the peace of mind that the bot will catch up to you. But of course, that's not the only distinctive feature!

Features

  • Counting from 1 to infinity in one designated Discord channel,
  • Users must follow counting rules, such as preventing double counting, not counting backwards, and skipping counts,
  • Users can get banned temporarily for counting mistakes, with severity determined by an exponential U-curve,
  • Built-in troll prevention to severely penalize users who intentionally count wrongly or delete their counting message,
  • Flexible customization options, including the ability to modify ban settings and bot reactions,
  • Keeps track of user and server statistics, like correct and incorrect counts and high scores,
  • Catches up on missed counts if users counted while the bot was offline,
  • Works seamlessly across an unlimited number of servers,
  • Counts any message that starts with a number.

Usage

To configure the bot for the first time, add it to your Discord server and use the /set channel command to let the bot know where it should keep track of counting. After that, ChadCounting is up and running and you can start competing!

Commands

The following commands could be used:

  • /set channel: sets the counting channel the bot will be active in.
  • /set reactions: allows you to change the way the bot reacts when you count.
  • /set banning: allows you to change banning settings, for instance, the ban duration.
  • /count current: shows you the current recorded count in case you're unsure.
  • /count highest: shows the server's high score and the average score.
  • /stats user: gives counting statistics of a user and tells you if you're a chad.
  • /stats server: shows the ranks of all users in the server based on their counting performance.
  • /stats global: shows the best servers participating in ChadCounting.
  • /banrate: shows how hard you will be penalized for making a mistake at different counts.
  • /help: gives basic information about ChadCounting.

Technical information

Dependencies

To run the Python program, the following dependencies need to be installed via pip3:

pip3 install -U discord.py (confirmed with version 2.3.2)
pip3 install -U python-dotenv (confirmed with version 1.0.0)
pip3 install -U emoji (confirmed with version 2.8.0)
pip3 install -U matplotlib (confirmed with version 3.8.0)
pip3 install -U pytz (confirmed with version 2023.3.post1)

Discord Developer Portal bot settings

When creating your own fork of ChadCounting, ensure your bot has at least the Send Message, Read Message History and Add Reactions OAuth2 permissions. Use External Emojis is an optional permission, but recommended. The scope should be bot.

Dev-mode

In the Initialisation region of the bot.py file, two development options can be enabled to facilitate the testing of real-world scenarios.

The first option, dev_active_single_guild, can be enabled to configure the bot to operate solely within a designated (testing) guild, thus preventing beta code from impacting production guilds. The dev_mode_guild_id should be set to the ID of this testing guild. This allows you to safely test new code without putting the production environment at risk.

The second option, dev_disable_apis, can be enabled to disable connections to APIs such as the bot websites top.gg and discordbotlist during development. It is recommended to have two separate Discord bots, one for production and one for development, to safely test new code. This option should be enabled when using a development bot account to prevent pushing the development bot's data to the APIs.

Link to add ChadCounting Dev to a guild

Updating the database

Counting and guild data is saved to a JSON database, eliminating the need for external database software. After changing values in the database, the current guilds need to be updated to corrospond to the new database values. Ensure to enable update_guild_data in the 'Initialisation' region of the bot.py file. The script will automatically create a backup of guild_data before updating. After updating and seeing ChadCounting is ready in the terminal, you can disable updating again.

Environment tables

For added security and to comply by Discord's ToS, create a .env file in the root directory of the ChadCounting bot folder (where bot.py is located). This file serves as the designated location to securely store bot tokens. To add your Discord bot tokens, follow the example below:

# .env
DISCORD_TOKEN=token_here
DEV_TOKEN=token_here
DISCORDBOTLIST_TOKEN=token_here
TOPGG_TOKEN=token_here
DISCORDS_TOKEN=token_here
DISCORDBOTSGG_TOKEN=token_here

Versioning

To properly manage versioning, it is recommended to update the bot_version variable in the Initialization section of the bot.py file every time a functional version is ready to be pulled to the main branch. This version will be displayed in the output of the /help command. ChadCounting uses semantic versioning and a version number is written as MAJOR.MINOR.PATCH, where:

  • MAJOR version is increased for incompatible changes to previous versions.
  • MINOR version is increased for new features that are backward-compatible.
  • PATCH version is increased for backward-compatible bug fixes.

When you are working on a new version and commit to the dev branch, ensure the version temporarily ends with -indev to indicate that the version is in development and might not function yet.

About

ChatCounting is a bot designed to keep track of counting from one to infinity in a specific channel on your Discord server.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages