A Discord bot that brews your follower counts
and serves them right in your channel names.
Installation / Configuration / Run it / Customize / Troubleshooting / FAQ
- What is this
- Features
- Supported platforms
- Requirements
- Installation
- Creating the Discord bot
- Setting up the Discord channels
- Configuration
- Running the bot
- Keeping it running 24/7
- How it works
- Customization
- Project structure
- Troubleshooting
- FAQ
- Disclaimer
- Contributing
- License
- Credits
Tallybrew checks how many followers you have on your social networks every 15 minutes and renames a few channels in your Discord server to show those numbers. Anyone who joins your server sees your stats at a glance, and you never have to type anything.
This is how the channels look:
Whowatch: 12.4K
TikTok: 85K
IG: 3.2K
X: 1.1K
Kick: 540
The whole bot is a single Python file. There is no database, no web panel and no slash commands to learn. You fill in a few variables, run it, and it keeps your channels up to date.
- Follower counts for 5 platforms in one bot.
- Counts are shown right in the channel names, so nobody has to run a command.
- Short number format:
1500becomes1.5Kand2000000becomes2M. - Renames a channel only when the number actually changed, which saves Discord's rate limit.
- Scraping runs in a separate thread, so the bot never freezes.
- Updates every 15 minutes, and the interval is easy to change.
- Works on Windows, macOS and Linux.
- Only needs the basic guilds intent. No privileged intents.
| Platform | How it gets the data | Needs an extra account |
|---|---|---|
| Whowatch | Whowatch public API | No |
| TikTok | Automated browser (Playwright) | No |
| Apify service | Yes, an Apify account | |
| X (Twitter) | Automated browser (Playwright) | No |
| Kick | Kick API through curl_cffi | No |
You can run it with only the platforms you care about. See Customization for how to remove the ones you do not use.
| Requirement | Details |
|---|---|
| Python | 3.8 or higher. Check with python --version. |
| Git | To clone the repo. |
| Discord bot | A bot application and its token (explained below). |
| Discord server | A server where you can manage channels. |
| Apify account | Only if you want Instagram. |
| Disk and memory | Playwright downloads its own Chromium, so leave some free disk space and at least 1 GB of free RAM. |
| Internet | The bot has to reach Discord and each platform. |
Python packages (installed for you from requirements.txt):
discord.py
playwright
apify-client>=2.0.0
curl_cffi
requests
git clone https://github.com/hypeblock26/tallybrew.git
cd tallybrew
A virtual environment keeps the bot's packages separate from the rest of your system.
Windows:
python -m venv venv
venv\Scripts\activate
Linux and macOS:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
This step is mandatory. Playwright needs to download its own Chromium to read TikTok and X. Without it, those two platforms fail.
playwright install chromium
If you are running it on a Linux server with no screen and you get missing library errors, also run:
playwright install-deps chromium
- Go to https://discord.com/developers/applications and click New Application.
- Name it whatever you want and open the Bot tab.
- Click Reset Token and copy the token. Save it somewhere, because Discord will not show it again.
- You do not need to enable any Privileged Gateway Intent. The bot only uses the guilds intent, which is on by default.
- Go to OAuth2, URL Generator:
- Under Scopes, check
bot. - Under Bot Permissions, check
Manage ChannelsandView Channels.
- Under Scopes, check
- Copy the generated URL at the bottom, open it in your browser, pick your server and authorize.
You can also build the invite link by hand. Replace YOUR_CLIENT_ID with the Application ID from the General Information tab:
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot&permissions=1040
The number 1040 is Manage Channels plus View Channels, which is everything the bot needs.
The bot renames channels, so you need to create the channels first. The cleanest setup is a small stats panel made of voice channels.
- Create a category, for example
Stats. - Inside it, create one voice channel per platform you want. Any name works, the bot will rename them.
- For each channel, open Edit Channel, Permissions and, for
@everyone, deny Connect while leaving View Channel allowed. This way everybody can see the numbers but nobody can join the channel. - Make sure the bot can see the category and has Manage Channels on it.
- Copy each channel's ID:
- In Discord, go to User Settings, Advanced and turn on Developer Mode.
- Right-click the channel and choose Copy Channel ID.
Text channels also work, but remember that Discord turns spaces in text channel names into dashes and lowercases everything, so TikTok: 85K would look different. Voice channels keep the name exactly as the bot writes it.
Open main.py and fill in the variables at the top of the file.
TOKEN = ''
APIFY_TOKEN = ''TOKEN: your Discord bot token, the one you copied when creating the bot.APIFY_TOKEN: your Apify token. You can get it at https://console.apify.com under Settings, API & Integrations. It is only needed for Instagram.
CANALES = {
"whowatch": 0,
"tiktok": 0,
"instagram": 0,
"twitter": 0,
"kick": 0,
}Paste the channel IDs you copied, as plain numbers without quotes.
Leaving an ID at 0 stops the bot from renaming that channel, but the bot still scrapes that platform. If you do not want a platform at all, remove it completely (see Removing a platform), especially Instagram, since every Apify run uses credits.
WHOWATCH_ID = ''
TIKTOK_USER = ''
IG_USER = ''
X_USER = ''
KICK_USER = ''| Variable | What to put | Example |
|---|---|---|
WHOWATCH_ID |
The numeric user ID on Whowatch, the number the Whowatch API uses in /users/<id>/profile |
'12345678' |
TIKTOK_USER |
TikTok username without the @ | 'yourusername' |
IG_USER |
Instagram username without the @ | 'yourusername' |
X_USER |
X username without the @ | 'yourusername' |
KICK_USER |
Kick username, as it appears in your channel URL | 'yourusername' |
Everything goes inside single quotes, including the Whowatch ID.
"X-Whowatch-Device-Id": ""Put any text with this format, for example "1700000000000-12345678". It does not have to be a real one, it just must not be empty.
TOKEN = 'your-discord-bot-token'
APIFY_TOKEN = 'your-apify-token'
CANALES = {
"whowatch": 111111111111111111,
"tiktok": 222222222222222222,
"instagram": 333333333333333333,
"twitter": 444444444444444444,
"kick": 555555555555555555,
}
WHOWATCH_ID = '12345678'
TIKTOK_USER = 'yourusername'
IG_USER = 'yourusername'
X_USER = 'yourusername'
KICK_USER = 'yourusername'python main.py
If everything is fine, you will see something like this in the console:
Bot online como YourBot#1234
Iniciando...
[OK] TikTok scrape: 85K
[OK] Twitter scrape: 1.1K
ok Whowatch: 12.4K
ok TikTok: 85K
ok X: 1.1K
The log messages are in Spanish, but they are easy to follow: ok means a channel was renamed, info ... sin cambios means the number did not change, and error shows what failed.
The first round starts as soon as the bot connects. A full round can take around a minute, because it starts a browser, waits between the TikTok and X checks and waits for the Apify run. After that, it repeats every 15 minutes.
To stop the bot, press Ctrl + C in the terminal.
If you close the terminal, the bot stops. To keep it alive on a server you have several options.
The simplest way on Linux:
screen -S tallybrew
python main.py
Detach with Ctrl + A and then D. To come back later:
screen -r tallybrew
pm2 start main.py --interpreter python3 --name tallybrew
pm2 save
pm2 startup
If you use a virtual environment, point --interpreter to its Python, for example ./venv/bin/python. See the logs with pm2 logs tallybrew.
Use this if you want the bot to start by itself when the machine boots and to restart if it crashes.
Create /etc/systemd/system/tallybrew.service:
[Unit]
Description=tallybrew Discord bot
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=youruser
WorkingDirectory=/home/youruser/tallybrew
ExecStart=/home/youruser/tallybrew/venv/bin/python -u main.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetReplace youruser and the paths with your own, then:
sudo systemctl daemon-reload
sudo systemctl enable --now tallybrew
journalctl -u tallybrew -f
The -u flag makes Python print logs right away instead of buffering them.
Run python main.py in a terminal and leave it open, or use Task Scheduler to start it when you log in.
- Every 15 minutes, a Discord task starts a scraping round in a separate thread, so the bot is never blocked.
- Each platform is queried with the method listed in Supported platforms:
- Whowatch: a request to the Whowatch API profile endpoint.
- Instagram: the
apify/instagram-followers-count-scraperactor, run through the Apify client. - Kick: a request to the Kick channel API using
curl_cffi, which imitates a real Chrome browser to get past basic anti-bot checks. - TikTok and X: a headless Chromium opened with Playwright that reads the follower number from the profile page.
- Numbers are converted to a short format:
1500becomes1.5Kand2000000becomes2M. - For every platform that returned a number, the bot looks up the channel by ID. If its current name is different from the new one, it renames it. If not, it does nothing, to avoid wasting Discord's rate limit.
- It waits 10 seconds after each channel so it does not hit Discord's rate limit.
A few things worth knowing:
- If a platform fails, the bot prints the error and keeps going with the others. One broken platform does not stop the rest.
- A platform that returns
0followers is skipped, so its channel keeps the old name. - TikTok and X numbers that already come abbreviated from the site, like
85.3K, are shown exactly as the site shows them.
All the options below are small edits in main.py.
In the update_stats function there is a dictionary with the labels:
nombres = {"whowatch": "Whowatch", "tiktok": "TikTok", "instagram": "IG", "twitter": "X", "kick": "Kick"}Change the text on the right to whatever you want. For example, if you set "tiktok": "TT Followers", the channel will be named TT Followers: 85K.
To change the whole format, edit this line in the same function:
nuevo_nombre = f"{nombres[key]}: {valor}"For example, f"{nombres[key]} | {valor}" gives TikTok | 85K.
The interval is set in the decorator of update_stats:
@tasks.loop(minutes=15)Change 15 to any number of minutes. Do not set it too low: TikTok and X can block you if you scrape them too often, and every Instagram update uses Apify credits.
If you do not use a platform, do both of these so it is not scraped at all:
- Delete its
tryblock insideejecutar_ronda_scraping. - Delete its line in the
CANALESdictionary and its entry in thedatadictionary at the top of the same function.
- Add a key to the
datadictionary inejecutar_ronda_scraping, for example"youtube": None. - Add a block that gets the follower count and stores it with
data["youtube"] = format_num(count). - Add the channel to
CANALES:"youtube": 0. - Add its label to the
nombresdictionary inupdate_stats.
tallybrew/
├── main.py the whole bot
├── requirements.txt Python dependencies
├── .gitignore
├── LICENSE MIT license
├── assets/
│ └── divider.svg the cat at the bottom of this README
└── README.md
The bot starts but the channels do not change
- Check that the channel IDs in
CANALESare correct and are plain numbers. A wrong ID is skipped silently. - Make sure the bot is in the server where those channels live.
- Make sure the bot has Manage Channels, and that no permission override on the channel or category denies it.
- Check that the platform actually returned a number. Look for
errorlines in the console.
discord.errors.LoginFailure: Improper token has been passed
The TOKEN is empty, has extra spaces or is wrong. Go to the Discord developer portal, open your bot, click Reset Token and paste the new one between the quotes.
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
The bot is in the server but cannot edit that channel. Give it Manage Channels and check the channel's permission overrides.
playwright._impl._errors.Error: Executable doesn't exist
You forgot to run playwright install chromium. On a Linux server you might also need playwright install-deps chromium.
TikTok or X fail with a timeout error
These sites change their pages often and sometimes block automated browsers. Try again later. If it always fails, they probably changed the HTML selector and it needs to be updated in the code:
- TikTok uses the selector
[data-e2e="followers-count"]. - X uses a link to
/<username>/verified_followers.
Instagram does not update
- Check that your
APIFY_TOKENis correct. - Check that you still have credits in your Apify account.
- Make sure you have
apify-clientversion 2.0.0 or higher:pip install -U apify-client.
Kick throws an error or returns nothing
Kick has anti-bot protection. The bot uses curl_cffi to imitate a real browser, but it can still get blocked sometimes. Try again later and make sure KICK_USER matches the name in your channel URL.
Whowatch returns nothing
Check that WHOWATCH_ID is the numeric user ID, between quotes, and that the X-Whowatch-Device-Id header is not empty.
A channel keeps the old name
Discord limits channel renames to 2 every 10 minutes. The bot already waits between changes, but if you restart it many times in a row it can hit that limit. Wait a few minutes and it will catch up.
A platform with 0 followers never shows up
On purpose, the bot skips a result of 0 so a failed request does not wipe your channel. Once the account has at least one follower, it will appear.
Does it cost money? The bot, Discord, Playwright and curl_cffi are free. Only Instagram goes through Apify, which has its own plans and credit system. Check Apify's pricing and raise the update interval if you want to spend less.
Do I have to use all 5 platforms? No. Remove the ones you do not need, as explained in Removing a platform.
Can I track several accounts of the same platform? Not out of the box. You would need to duplicate that platform's block and add another channel for each account.
Can I use it in more than one server? Not out of the box. Channel IDs are tied to one server, so you would need to run one copy of the bot per server, or extend the code to loop over several channel sets.
Does it work on Windows? Yes. Use the Windows commands from the installation section.
Why do some numbers look like 85.3K and others like 1.1K?
TikTok and X sometimes give the number already abbreviated. The bot cannot turn 85.3K back into an integer, so it shows it as the site does.
Can I change how often it updates? Yes, see Changing the update interval.
Does the bot need to be online all the time? Only to keep the numbers fresh. If it goes offline, the channels simply keep their last name until the bot comes back.
This project gets public data from social networks through scraping and unofficial APIs. Those platforms can change or block these methods at any time, and scraping may go against their terms of service. Use it at your own risk.
Bug reports and ideas are welcome.
- Open an issue describing the problem or the idea.
- To send code, fork the repository and create a branch:
git checkout -b my-change - Make your change and test it with your own tokens, without committing them.
- Open a pull request explaining what you changed and why.
Released under the MIT License.
Built with:
Brewed by hypeblock26