Easy to extend and support
!play [url or name] - play song from any stream/video or youtube search
!loop - enable/disable queue loop
!queue - current bot song queue
!pause - pause current song
!resume - resume paused song
!skip - skip current song
!clear - clear bot queue
!message-clean - clear bot messages
!studio21 - play radio studio21
!21queue - show studio21 queue
Just add queue in config.toml
bot: DiscordBot
async def task():
print('done in background')
await bot.add_task('my_queue', task)
All bot configuration in config.toml
The only exception is secrets. They must be set in environment or in file .env:
DISCORD_TOKEN -- bot token
brew install ffmpeg
pip intall -r requirements.txt
docker build -t discord-music-bot .
docker run discord-music-bot
python main.py
pip install -r test-requirements.txt
pytest tests/
Just create new class with handle
method and add router.command
decorator
To register this command import it in lib/commands/__init__.py
For auto help generation add __doc__
for your new command
You can create commands with dependencies
All you need is just add them to class signature
Injector will resolve and inject all classes with magic methods __connect__
, __disconnect__
from ClientProtocol
interface
Also, you can initialize clients from config. Just add __from_config__
method from FileConstructable
interface
from dataclasses import dataclass
from lib.core.injector import ClientProtocol
from lib.core.router import router
class MyClient(ClientProtocol):
def do(self):
print('DID SOMETHING')
@router.command('command')
@dataclass
class MyCommand:
client: MyClient # will be auto injected
async def handle(self, ctx):
self.client.do()
- Write tests on bot business logic