Spaces:
Running
π€ QueenNoxi β Complete Setup Guide
Get every API key and config value needed to run the bot.
1. Telegram API Credentials (API_ID & API_HASH)
- Go to my.telegram.org
- Log in with your phone number
- Click "API development tools"
- Create an app (any name/platform is fine)
- Copy App api_id β
API_ID - Copy App api_hash β
API_HASH
2. Bot Token (TOKEN)
- Open Telegram β message @BotFather
- Send
/newbot - Choose a name (display name, e.g.
Queen Noxi) - Choose a username (must end in
bot, e.g.QueenNoxiGroupBot) - BotFather replies with your token:
β123456789:AABBccDDeeFFggHHiiJJ...TOKEN - Also set
BOT_NAME= the display name you chose - Also set
BOT_USERNAME= the username without @
Tip: Also send
/setprivacyβDisableto let the bot read all group messages.
3. Your Owner ID (OWNER_IDS)
Message @userinfobot on Telegram.
It replies with your numeric user ID, e.g. 123456789.
To add multiple owners, separate with spaces:
OWNER_IDS=123456789 987654321
4. MongoDB (MONGO_DB_URI)
You already have MongoDB Atlas β reuse the same cluster or create a new database in it.
To add a new database in your existing Atlas cluster:
- Go to cloud.mongodb.com
- Open your cluster β Browse Collections β Add My Own Data
- Create a database named
QueenNoxi - Your existing connection URI works β just change the DB name at the end:
βmongodb+srv://user:pass@cluster.xxxxx.mongodb.net/QueenNoxi?retryWrites=true&w=majorityMONGO_DB_URI
5. PostgreSQL Database (DATABASE_URL)
π Recommended: Neon.tech
(Free forever β serverless, no credit card, never sleeps)
- Sign up at neon.tech (GitHub login works)
- Click "New Project" β choose a region closest to you
- Wait ~10 seconds for provisioning
- Go to Dashboard β Connection Details
- Select "Pooled connection" and copy the string:
βpostgresql://user:pass@ep-xxx.us-east-2.aws.neon.tech/neondb?sslmode=requireDATABASE_URL
| Alternative | Free Tier | Notes |
|---|---|---|
| Supabase | 500 MB | Pauses after 1 week inactive |
| Railway | $5 credit/mo | Easiest UI |
| Aiven | 1 free service | Good uptime |
6. Support Chat (SUPPORT_CHAT)
You can provide either a public username or a full invite link.
- Public Group: Set
SUPPORT_CHAT=yourgroupusername(without@) - Private Group: Set
SUPPORT_CHAT=https://t.me/+xyz123...(full invite link)
The bot will automatically handle either format for the support buttons in the menu.
7. Start Image (START_IMG)
Any direct image URL (must end in .jpg, .png, .webp).
Quick options:
- Upload to imgbb.com β get direct link
- Use any public Telegram CDN URL
- Use a raw GitHub image URL
8. Log Channel (EVENT_LOGS)
- Create a private Telegram channel
- Add your bot as admin
- Forward any message from the channel to @getidsbot
- Copy the channel ID (looks like
-100xxxxxxxxxx) βEVENT_LOGS
9. Optional API Keys
| Variable | Service | Cost | Link |
|---|---|---|---|
CASH_API_KEY |
Currency conversion | Free | api.freecurrencyapi.com |
TIME_API_KEY |
Timezone lookup | Free | timezonedb.com |
10. Deploying on HuggingFace Spaces
- Push this repo to Hugging Face
- Space SDK: Docker
- Visibility: Public or Private
- After creating, go to Settings β Variables and secrets
- Add each key below as a Secret (sensitive) or Variable:
| Type | Variables |
|---|---|
| π Secret | API_ID, API_HASH, TOKEN, MONGO_DB_URI, DATABASE_URL, OWNER_IDS |
| π Variable | BOT_NAME, BOT_USERNAME, SUPPORT_CHAT, START_IMG, EVENT_LOGS, WORKERS |
- The Space auto-builds and starts β watch Logs for any errors.
- Your bot should come online within 2β3 minutes.
Health check: HuggingFace pings
https://your-space.hf.space/healthThe bot responds withβ QueenNoxi is running!
11. Minimum Required .env for Local Testing
API_ID=12345678
API_HASH=your_api_hash_here
TOKEN=bot:token_here
OWNER_IDS=123456789
MONGO_DB_URI=mongodb+srv://user:pass@cluster.mongodb.net/QueenNoxi
BOT_NAME=QueenNoxi
BOT_USERNAME=yourbotusername
Run locally with:
# Load .env vars and start the bot
Get-Content .env | ForEach-Object { if ($_ -match '^([^#=]+)=(.*)$') { [System.Environment]::SetEnvironmentVariable($Matches[1].Trim(), $Matches[2].Trim()) } }
python app.py