Mafic
A properly typehinted lavalink client for discord.py, nextcord, disnake and py-cord.
Installation
pip install mafic
Note Use
python -m,py -m,python3 -mor similar if that is how you install packages. Generally windows usespy -m pipand linux usespython3 -m pip
Discord Server
Join the Discord Server for support and updates.
Documentation
Features
- Fully customisable node balancing.
- Multi-node support.
- Filters.
- Full API coverage.
- Properly typehinted for Pyright strict.
Usage
Go to the Lavalink Repository to set up a Lavalink node.
import os
import mafic
import nextcord
from nextcord.ext import commands
class MyBot(commands.Bot):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.pool = mafic.NodePool(self)
self.loop.create_task(self.add_nodes())
async def add_nodes(self):
await self.pool.create_node(
host="127.0.0.1",
port=2333,
label="MAIN",
password="<password>",
)
bot = MyBot(intents=nextcord.Intents(guilds=True, voice_states=True))
@bot.slash_command(dm_permission=False)
async def play(inter: nextcord.Interaction, query: str):
if not inter.guild.voice_client:
player = await inter.user.voice.channel.connect(cls=mafic.Player)
else:
player = inter.guild.voice_client
tracks = await player.fetch_tracks(query)
if not tracks:
return await inter.send("No tracks found.")
track = tracks[0]
await player.play(track)
await inter.send(f"Playing {track.title}.")
bot.run(...)
Metadata
Release files for mafic 2.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mafic-2.11.0.tar.gz | 41.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mafic-2.11.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 91.4 kB
Release files / mafic-2.11.0.tar.gz
| Download URL | mafic-2.11.0.tar.gz |
|---|---|
| Size | 41.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82309ff08fff91dd6521dda4fe533c7f93b19d3bfa8ade7bdedf4af9f0da8a6e
|
|
BLAKE2b-256 checksum How to use checksums |
0ec7c96f55278a3626749933eb965322bb48f212b3c08edaa7c8b377078513f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / mafic-2.11.0-py3-none-any.whl
| Download URL | mafic-2.11.0-py3-none-any.whl |
|---|---|
| Size | 49.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80fc658c3103035bfd04533c9d3f9bd25d38b000e3a2dd2ea7a0c1e9c50f4168
|
|
BLAKE2b-256 checksum How to use checksums |
5307495c766d86d99017442fe75e88f11c2fcf221dfb45151fff9c713ead8f17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for mafic 2.11.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.