A Python wrapper for the lolka bot API (discord.py-compatible fork)
Project description
Fork of discord.py (MIT License, © 2015-present Rapptz).
lolka.py (imported as import lolka) is a Python wrapper for the lolka bot API. It targets lolka by default — no manual REST/Gateway overrides needed — decodes lolka snowflakes, and resolves lolka CDN asset URLs. See LICENSE for licensing (the original MIT copyright is retained).
Installing
Python 3.8 or higher is required
# Linux/macOS
python3 -m pip install -U lolka.py
# Windows
py -3 -m pip install -U lolka.py
Quick Example
import lolka
class MyClient(lolka.Client):
async def on_ready(self):
print('Logged on as', self.user)
async def on_message(self, message):
if message.author == self.user:
return
if message.content == 'ping':
await message.channel.send('pong')
intents = lolka.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)
client.run('token')
Bot Example
import lolka
from lolka.ext import commands
intents = lolka.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='>', intents=intents)
@bot.command()
async def ping(ctx):
await ctx.send('pong')
bot.run('token')
Voice
Voice works over WebRTC (lolka’s voice stack), not Discord’s UDP transport. The required dependencies ship with the base install — nothing extra to add.
The API stays discord.py-compatible — await channel.connect() returns a VoiceClient that speaks lolka’s WebRTC voice under the hood:
vc = await channel.connect()
vc.play(lolka.FFmpegPCMAudio('song.mp3'))
# receive/record other participants' audio (optional):
def on_track(track, user_id, producer_id):
... # track is an aiortc MediaStreamTrack
vc.on_receive_track = on_track
...
await vc.disconnect()
Migrating from discord.py
Already have a discord.py bot? You don’t have to rewrite it — just alias the import:
import lolka as discord
from lolka.ext import commands
# everything below is unmodified discord.py bot code
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='>', intents=intents)
@bot.command()
async def ping(ctx):
await ctx.send('pong')
bot.run('token')
import lolka as discord covers every discord.Whatever attribute access in your existing code (discord.Client, discord.Intents, discord.Embed, checks, errors, and so on). The only lines that actually need editing are explicit submodule imports, since Python resolves those by real module path rather than by the alias:
import discord → import lolka as discord
from discord import X → from lolka import X
from discord.ext import commands → from lolka.ext import commands
from discord import app_commands → from lolka import app_commands
That’s it — the rest of your bot’s code stays exactly as it is.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lolka_py-0.5.0.tar.gz.
File metadata
- Download URL: lolka_py-0.5.0.tar.gz
- Upload date:
- Size: 629.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
982dbeda84cfe81156a746b914a8b68f5d91b5faa69227b44a131c9aed857d27
|
|
| MD5 |
aef5b9659457408acac1b172ff8bcdad
|
|
| BLAKE2b-256 |
9c05f755a8695532b26c1459d53b0ce8613543124c22599755fbb065caf3ccc6
|
Provenance
The following attestation bundles were made for lolka_py-0.5.0.tar.gz:
Publisher:
release.yml on Lolka-App/lolka.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lolka_py-0.5.0.tar.gz -
Subject digest:
982dbeda84cfe81156a746b914a8b68f5d91b5faa69227b44a131c9aed857d27 - Sigstore transparency entry: 2039157910
- Sigstore integration time:
-
Permalink:
Lolka-App/lolka.py@713421545b985407786e091fe9593702fec4d84a -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/Lolka-App
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@713421545b985407786e091fe9593702fec4d84a -
Trigger Event:
push
-
Statement type:
File details
Details for the file lolka_py-0.5.0-py3-none-any.whl.
File metadata
- Download URL: lolka_py-0.5.0-py3-none-any.whl
- Upload date:
- Size: 754.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfd9e8bb06bc79256724d79174e7922c80e1659c5ba744c1956f27712e3fe37b
|
|
| MD5 |
c90d620b4f3bdc4f9a7655e40b4e4e81
|
|
| BLAKE2b-256 |
c4eb9e49762a7399caf5ec327295bf961bbceeda165414952ce4db8b0c7f2a2a
|
Provenance
The following attestation bundles were made for lolka_py-0.5.0-py3-none-any.whl:
Publisher:
release.yml on Lolka-App/lolka.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lolka_py-0.5.0-py3-none-any.whl -
Subject digest:
cfd9e8bb06bc79256724d79174e7922c80e1659c5ba744c1956f27712e3fe37b - Sigstore transparency entry: 2039158079
- Sigstore integration time:
-
Permalink:
Lolka-App/lolka.py@713421545b985407786e091fe9593702fec4d84a -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/Lolka-App
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@713421545b985407786e091fe9593702fec4d84a -
Trigger Event:
push
-
Statement type: