โจ Features ยท ๐ผ๏ธ Preview ยท ๐ง AI Autoplay ยท ๐ Deploy ยท โ๏ธ Configuration ยท ๐ฎ Commands ยท ๐ ๏ธ Help
|
|
|
|
What the bot sends in your group:
๐ Searching โ Added to Queue
๐ต Query kesariya ๐ Title Tum Hi Ho
๐ค Requested By Rishu โฑ Duration 4:22 min
๐ง Mode Audio ๐ค Requested By Rishu
โณ Status Searching... ๐ Position #2 in queue
๐ง Mode Audio
๐ต Track Info
๐ Title Kesariya
โฑ Duration 4:28 min [ โท ] [ Autoplay: ON ] [ II ]
๐ค Requested By Rishu [ โป ] [ โถโถ| ] [ โก ]
๐ง Mode Audio [ ๐ต Audio ] [ ๐ฌ Video ]
The buttons are coloured (blue, green, red) and the Audio / Video buttons send the track straight to your DM.
When the queue is about to end, the AI picks what plays next. It only suggests song names, so a failing AI can never stop the music.
flowchart LR
A([๐ต Song playing]) --> B{Autoplay ON?}
B -- no --> Z([โน Stops when the queue ends])
B -- yes --> C["๐ค AI suggests 8 related songs<br/>(skips the ones already played)"]
C -- AI failed --> F["๐ Fallback: YouTube search + Mix"]
C --> D["๐ Each name is searched on YouTube"]
F --> E
D --> E["โฌ๏ธ Downloaded in the background"]
E --> G([โถ๏ธ Plays next ยท history saved in MongoDB])
- Providers: Gemini first, then Groq. Retired models are skipped and current ones are found automatically.
- No repeats: the last 300 songs of every chat are stored in MongoDB.
- Visible: the owner gets
๐ค AI autoplay worksonce, orโ ๏ธ AI autoplay gave no songswith the reason.
| What | Notes |
|---|---|
| Python | 3.10+ (Docker image: 3.10, Heroku runtime: 3.11) |
| FFmpeg ยท Node.js 20 | Needed for streaming (both are in the Docker image) |
| MongoDB | A free Atlas cluster is enough |
API_ID, API_HASH |
From my.telegram.org |
| Bot token | From @BotFather |
| Assistant session | A Pyrogram v2 string session of a normal user account |
โ ๏ธ Rich cards need Kurigram โฅ 2.2.26.pyroforkinstalls a package with the samepyrogramname and can replace Kurigram, so do not install both.
Press the Deploy to Heroku button at the top, fill in the variables, deploy.
git clone https://github.com/RishuBot/RishuMusic
cd RishuMusic
cp sample.env .env # fill in your values
docker build -t rishumusic .
docker run --env-file .env rishumusicOn Railway, Render and Koyeb, create a worker service from your fork (it uses the Dockerfile) and add the variables in the dashboard.
pip install -U -r requirements.txt
cp sample.env .env
bash startThen add the bot to your group, make it admin, start a voice chat and send play <song name>.
Everything is an environment variable, read in config.py. Never put real values in the code.
Required
| Variable | Description |
|---|---|
API_ID, API_HASH |
Telegram API credentials |
BOT_TOKEN |
Token from BotFather |
MONGO_DB_URI |
MongoDB connection string |
OWNER_ID |
Your Telegram user id (receives owner alerts) |
LOGGER_ID |
Id of a log group, with the bot as admin |
STRING_SESSION |
Pyrogram v2 string session of the assistant account |
Optional: general
| Variable | Default | Description |
|---|---|---|
STRING_SESSION2 โฆ STRING_SESSION5 |
none | More assistant accounts |
DURATION_LIMIT |
300 |
Longest allowed track, in minutes |
PLAYLIST_FETCH_LIMIT |
25 |
Max songs taken from a playlist |
ASSISTANT_LEAVE_TIME |
5400 |
Seconds before an idle assistant leaves a chat |
SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET |
set your own | For Spotify links (dashboard) |
SUPPORT_CHANNEL, SUPPORT_CHAT |
set your own | Links shown on the start card |
HEROKU_APP_NAME, HEROKU_API_KEY |
none | Only for /update and /restart on Heroku |
UPSTREAM_BRANCH |
main |
Branch used by /update |
Optional: download APIs
| Variable | Default | Description |
|---|---|---|
MUSIC_API_URL, MUSIC_API_KEY |
built-in URL, set your own key | Music download API used for playback |
DL_API_URL |
https://vapters.site/stream |
API behind the Audio / Video buttons |
DL_AUDIO_QUALITY |
192 |
Audio bitrate for the button |
DL_VIDEO_QUALITY |
720 |
Video quality for the button |
Optional: AI autoplay (set at least one key, both are free)
| Variable | Description |
|---|---|
GEMINI_API_KEY |
Free key from Google AI Studio |
GROQ_API_KEY |
Free key from Groq Console |
GEMINI_MODEL, GROQ_MODELS |
Leave empty for automatic model choice |
POLLINATIONS_KEY |
Optional third provider (needs a key) |
AI_AUTOPLAY |
0 turns the AI part off completely |
Optional: performance
| Variable | Default | Description |
|---|---|---|
CARD_UPLOAD |
1 |
1 uploads the generated thumbnail to a temporary host (max 4 s). 0 always uses the YouTube thumbnail (fastest) |
SLOW_REPORT_SECONDS |
6 |
A step slower than this is reported to the owner |
โถ๏ธ Play
| Command | Description |
|---|---|
/play <name or link> or play <name or link> |
Play audio |
/vplay |
Play video |
/cplay ยท /cvplay |
Play in the linked channel's voice chat |
/playforce ยท /vplayforce ยท /cplayforce ยท /cvplayforce |
Skip the queue and play now |
/playmode ยท /channelplay |
Choose play mode / channel |
/queue ยท /player |
Show the queue / current player |
/autoplay on | off |
Turn AI autoplay on or off |
โฏ๏ธ Player controls (admins)
/pause /resume /skip /stop /end /loop /shuffle /seek /seekback /speed
Channel versions start with c, for example /cskip. Most of them are also buttons under the player card.
๐งฐ Tools
/start /help /settings /lang /ping /stats /speedtest /activevc /auth /unauth /authlist /reload
๐ Owner / sudo
/broadcast /gban /ungban /block /unblock /blchat /addsudo /delsudo /sudolist /maintenance /logger /autoend /restart /update /getlog
| Message | What it means |
|---|---|
๐ค AI autoplay works (provider: โฆ) |
The AI is running and suggesting songs |
โ ๏ธ AI autoplay gave no songs |
The AI failed and the text shows why. The old method was used instead |
๐ข Slow step: join_call took 14.2s |
One step was slow. The name tells you where to look: download, join_call, thumbnail, card |
โ ๏ธ stream._rich_photo_card [โฆ] failed |
Telegram refused a rich feature and the bot fell back automatically |
Show the folders
RishuMusic/
โโโ config.py # all settings, read from environment variables
โโโ sample.env # template for your .env
โโโ app.json ยท Dockerfile ยท Procfile ยท heroku.yml ยท start
โโโ docs/banner.svg
โโโ strings/ # language files
โโโ RishuMusic/
โโโ core/ # bot, assistants, voice-chat calls, MongoDB
โโโ platforms/ # YouTube, Spotify, Apple, Resso, SoundCloud, Telegram
โโโ plugins/
โ โโโ play/ # play, live, playmode, download buttons
โ โโโ admins/ # pause, skip, loop, seek, speed, callbacks
โ โโโ bot/ # start, help, settings
โ โโโ tools/ # queue, autoplay, ping, stats, language
โ โโโ sudo/ # gban, block, maintenance, restart
โ โโโ misc/ # broadcast, auto-leave, watcher
โโโ utils/
โโโ stream/ # streaming and the Now Streaming / Queue cards
โโโ autoplay/ # AI + YouTube related songs, history, prefetch
โโโ inline/ # keyboards
โโโ rich_ui.py # rich message helpers
โโโ play_buttons.py # button colours and the autoplay toggle
โโโ thumbnails.py # thumbnail rendering
| Problem | Fix |
|---|---|
| Cards are plain, no table or colours | Make sure Kurigram โฅ 2.2.26 is the installed pyrogram, and remove pyrofork from requirements.txt |
| Bot does not join the voice chat | Make the bot admin, start a voice chat first, and check that the assistant account is not banned in the group |
| Songs repeat in autoplay | Add GEMINI_API_KEY or GROQ_API_KEY and watch your DMs for โ ๏ธ AI autoplay gave no songs |
| The bot feels slow | Look for ๐ข Slow step DMs. Try CARD_UPLOAD=0 and AI_AUTOPLAY=0 to see what changes |
| Audio / Video button cannot send the file | The user must open the bot in DM and press Start once |
- Put every secret (bot token, string sessions, MongoDB URI, API keys) in environment variables. Never commit them.
- If a secret was ever committed, treat it as leaked and rotate it: new bot token from BotFather, new database password, new API keys.
If RishuMusic helps you, a star takes two seconds and keeps the project going.
Built on the open-source Pyrogram / Kurigram + py-tgcalls music-bot ecosystem. Thanks to Rishu.
Maintained by Rishu ยท Telegram @RishuCoder
โญ Star ยท ๐ด Fork ยท ๐ Report ยท ๐ฌ Say hi