8888888 8888888888 .8. ,o888888o. 8 888888888o ,o888888o. 8888888 8888888888
8 8888 .888. 8888 `88. 8 8888 `88. . 8888 `88. 8 8888
8 8888 :88888. ,8 8888 `8. 8 8888 `88 ,8 8888 `8b 8 8888
8 8888 . `88888. 88 8888 8 8888 ,88 88 8888 `8b 8 8888
8 8888 .8. `88888. 88 8888 8 8888. ,88' 88 8888 88 8 8888
8 8888 .8`8. `88888. 88 8888 8 8888888888 88 8888 88 8 8888
8 8888 .8' `8. `88888. 88 8888 8888888 8 8888 `88. 88 8888 ,8P 8 8888
8 8888 .8' `8. `88888.`8 8888 .8' 8 8888 88 `8 8888 ,8P 8 8888
8 8888 .888888888. `88888. 8888 ,88' 8 8888 ,88' ` 8888 ,88' 8 8888
8 8888.8' `8. `88888. `8888888P' 8 888888888P `8888888P' 8 8888
- 👋 Overview
- ✅ Dependencies
- 🌵 File Structure
- 💾 Data
- 🏃 Preliminary Steps
- 🔧 Environment Variables
- 🚀 Getting Started
- 📚 Discord Bot Commands
- 🎮 Supported Platforms
- 🚀 Deploy
- 🔧 Troubleshooting
- 🤝 Contribute
- 🚨 Security Issues
- 🗺️ Roadmap
🎮 Tired of chasing down gamer tags before your match? Or waiting scrolling through your messages for your competitors tag?! Well meet Tagbot, your new Discord sidekick for online FGC tournaments.
🔥 Meet Tagbot , your new Discord sidekick for online FGC tournaments. It grabs your opponent's tag instantly, so you can stop waiting and start playing.
- Couchbase DB
- Redis DB
- Python v3
- Discord
- Docker
├── CHANGELOG.md
├── Dockerfile
├── README.md
├── bot
│ └── tagbot.py
├── contribute
│ ├── CONTRIBUTE.md
│ └── PULL_REQUEST_TEMPLATE.md
├── db
│ ├── couchbasedb.py
│ └── redisdb.py
├── docker-compose.yml
├── env.template
├── logs
│ └── tagbot-application.log
├── requirements.txt
├── run.py
├── site
│ ├── README.md
│ ├── app
│ ├── components
│ ├── eslint.config.mjs
│ ├── next-env.d.ts
│ ├── next.config.ts
│ ├── package.json
│ ├── postcss.config.mjs
│ ├── public
│ ├── tailwind.config.js
│ ├── tsconfig.json
│ └── utils
├── terraform
│ ├── main.tf
│ ├── network.tf
│ ├── outputs.tf
│ ├── redis.tf
│ ├── site.tf
│ ├── tagbot.tf
│ └── variables.tf
├── test
│ ├── test_couchbasedb.py
│ ├── test_get_prefix.py
│ ├── test_redisdb.py
│ └── test_tagbot.py
└── utils
├── check_env.py
├── default_msg.py
├── get_prefix.py
└── logger.py
The data is stored in a NoSQL database called Couchbase. Each entry follows this format.
"DISCORD_USER_ID": {
"psn":""
"wb": "",
"tekken": "",
"sf": "",
"steam": "",
"xbox": ""
}python -m venv .venv
source .venv./bin/activate
pip install -r requirements.txtnvm use
npm installCopy .env.template to .env and configure:
| Variable | Description | Required |
|---|---|---|
| DISCORD_TOKEN | Your Discord bot token | Yes |
| DISCORD_APPLICATION_ID | Your Discord Application ID | Yes |
| DISCORD_PUBLIC_ID | Your Discord Public ID | Yes |
| DISCORD_IMAGE | Your Discord Logo URL | No |
| COUCHBASE_CONNECTION | Couchbase connection string | Yes |
| COUCHBASE_USERNAME | Couchbase username string | Yes |
| COUCHBASE_PASSWORD | Couchbase password string | Yes |
| COUCHBASE_BUCKET | Couchbase bucket name string | Yes |
| COUCHBASE_COLLECTION | Couchbase collection name string | Yes |
| COUCHBASE_SCOPE | Couchbase scope string | Yes |
| REDIS_HOST | Redis connection string | Yes |
| REDIS_PORT | Redis Port integer | Yes |
| REDIS_PASSWORD | Redis password string | Yes |
| REDIS_SSL | Redis SSL settings boolean | Yes |
- Discord Bot: Handles Discord interactions (
bot/tagbot.py) - Website: Next.js frontend for providing information about the bot (`site/)
- Databases: Couchbase for data storage, Redis for caching
- Infrastructure: Terraform for Microsoft Azure
To lint all the python files run black .
To run all unit test for the bot run pytest
To run the Discord bot python run.py
To lint all javascript files run npm run lint
To run the website run npm run dev and go to http://localhost:3000
To generate production files for the website run npm run build. The output of those files will be in /out directory.
| Command | Description | Usage | Example | Permissions |
|---|---|---|---|---|
add |
Set your gaming tag for a specific platform | !tagbot add <platform> <tag> |
!tagbot add psn thestrugglingblack |
User |
tag |
Get a user's gaming tags | !tagbot tag <@user> |
!tagbot tag @thestrugglingblack |
User |
healthcheck |
View the health status of Tagbot | !tagbot healthcheck |
!tagbot healthcheck |
User |
list |
List all supported gaming platforms | !tagbot list |
!removetag psn |
User |
support |
List information in getting in contact with the developers of TagBot | !tagbot support |
!tagbot support |
User |
commands |
List all commands for TagBot | !tagbot commands |
!tagbot commands |
User |
| Tag | Platform Name |
|---|---|
psn |
PlayStation Network |
wb |
Warner Bros Games |
xbox |
Xbox Live |
steam |
Steam |
sf |
Street Fighter |
tekken |
Tekken |
TagBot is deployed on Microsoft Azure using Infrastructure as Code (Terraform) with automated CI/CD pipelines.
The application uses the following Azure services:
- Azure Container Instances : hosts the Discord bot
- Azure Static Web Apps: hosts Next.js website for the bot
- Azure Cache for Redis: caching and session storage
- Azure Storage Account: store the application logs and Terraform state management
- Azure CLI
- Terraform
- Azure Subscription
- GitHub Action Secrets
Log in to Azure CLI
export ARM_SUBSCRIPTION_ID=$(az account show --query id --output tsv)
export ARM_TENANT_ID=$(az account show --query tenantId --output tsv)
az loginCreate a resource group.
az group create --name tagbot-resources --location "East US"Create a storage account for terraform state files and container logs.
az storage account create \
--name tagbottfstate \
--resource-group tagbot-resources \
--location "East US" \
--sku Standard_LRS \
--kind StorageV2
az storage container create \
--name tfstate \
--account-name tagbottfstate# Navigate to directory
cd terrfaform
# Initialize Terraform
terraform init
# Plan deployment
terraform plan
# Apply infrastructure
terraform applyRequired secrets for GitHub Actions.
| Name | Description |
|---|---|
AZURE_CREDENTIALS |
Azure service principal credentials for authentication |
AZURE_STATIC_WEB_APPS_API_TOKEN |
API token for Azure Static Web Apps deployment |
COUCHBASE_BUCKET |
Couchbase bucket name |
COUCHBASE_BUCKET_NAME |
Couchbase bucket name (alternative) |
COUCHBASE_COLLECTION |
Couchbase collection name |
COUCHBASE_CONNECTION |
Couchbase connection string |
COUCHBASE_PASSWORD |
Couchbase database password |
COUCHBASE_SCOPE |
Couchbase scope name |
COUCHBASE_USERNAME |
Couchbase database username |
DISCORD_APPLICATION_ID |
Discord application ID |
DISCORD_PUBLIC_ID |
Discord public key |
DISCORD_TOKEN |
Discord bot token |
GH_TOKEN |
GitHub personal access token |
NEXT_PUBLIC_GITHUB_TOKEN |
Public GitHub token for frontend |
The deployment work flow goes as follows:
- Code Push
- Build + Lint + Test
- Terraform Plan
- Deploy Infrastructure
- Deploy Discord Bot
- Deploy Website
To view the logs of the Discord Bot.
az container logs --resource-group tagbot-resources --name tagbot-containerTo update the container with new image.
az container restart --resource-group tagbot-resources --name tagbot-containerTo undo a deployment.
terraform apply -target=azurerm_container_group.tagbot- Bot not responding: Check Discord token and permissions. Verify that you have
Message Content Intentenabled. - Database connection errors: Verify that the environment variables
COUCHBASE_CONNECTIONandREDIS_HOSTare the correc information. - Missing tags: Ensure that the user used the correct command and set their tags first.
Go to logs/tagbot-application.log to view all transactions and detailed error information.
We welcome contributions from the community! Whether its fixing bugs, adding features, improving documentation or suggestions all inputs are deeply appreciated.
- Check if existing issues and pull requests to avoid duplicates.
- For major additions, please open a issue first for discussion.
- Python: Follow PEP 8 standards.
- JS/TS: Follow setup in eslint configuration.
- Commits: Use clear and descriptive commit messages.
- Documentation: Update relevant documentation and the website directory
Contributors are recognized in:
- Release notes for significant contributions.
- Special thanks in the README for major features.
For additional information on contributing check out our contributions page here
Found a security vulnerability? Please DO NOT open a public issue please....
- Send Zuri a DM on twitter
- Provide detailed information about the vulnerability.
- Allow us some time to deal with the issue before public disclosure.
- Add Discord bot to top.gg directory

