Jubbio Bot API için Python kütüphanesi
Project description
jubbio.py
Jubbio botları geliştirmek için modern, asenkron ve nesne yönelimli bağımsız (unofficial) Python kütüphanesi.
DİKKAT: Bu proje topluluk tarafından geliştirilmiştir ve Jubbio geliştiricileri/sahipleri ile hiçbir resmi bağlantısı yoktur. Jubbio API'sini kullanmak için gayri-resmi bir köprü görevi görür.
Kurulum • Özellikler • Örnekler • Dokümantasyon
Temel Özellikler
- Tamamen Asenkron:
aiohttpveasyncioaltyapısı ile "non-blocking" performans. - Tanıdık ve Sezgisel:
discord.pybenzeri, öğrenmesi kolay dekoratör (@client.event) tabanlı tasarım. - Tam Donanımlı: Slash komutları, embedler (zengin kartlar), butonlar (ActionRow) ve fazlası.
- Ses & Müzik: LiveKit tabanlı ses kanalı desteği, YouTube'dan müzik çalma (
yt-dlp+FFmpeg), kuyruk sistemi, atlama ve durdurma. - Dayanıklı Gateway: WebSockets üzerinden kopmalara karşı otomatik yeniden bağlanma ve rate-limit yönetimi.
Kurulum
Paketi kurmanın en kolay yolu PyPI üzerinden pip kullanmaktır:
pip install -U jubbio.py
Ses desteği (Voice) için ek bağımlılıklar:
pip install -U "jubbio.py[voice]"
Hızlı Başlangıç
Basit bir ping-pong botu yazmak sadece birkaç satır sürer:
import jubbio
client = jubbio.Client()
@client.event
async def on_ready():
print(f'Sisteme giriş yapıldı: {client.user}')
@client.event
async def on_message(message):
if message.author.bot:
return
if message.content == '!ping':
embed = jubbio.Embed(
title="Pong!",
description="Bot aktif ve çalışıyor.",
color=0x2ECC71
)
await message.channel.send(embed=embed)
client.run('BOT_TOKEN_BURAYA')
Slash Komutları (Uygulama Komutları)
@client.event
async def on_ready():
cmd = jubbio.SlashCommand(
name='profil',
description='Kullanıcı profilini görüntüler',
)
await client.register_command(cmd)
@client.command(name='profil')
async def profil_komutu(interaction):
embed = jubbio.Embed(
title=f"{interaction.user.display_name}",
color=0x9B59B6
)
embed.add_field(name='ID', value=interaction.user.id, inline=True)
embed.add_field(name='Kullanıcı Adı', value=interaction.user.username, inline=True)
embed.set_footer(text="jubbio.py")
await interaction.respond(embed=embed)
Butonlar ve Etkileşimler (Components)
@client.event
async def on_message(message):
if message.content == '!onay':
embed = jubbio.Embed(
title="Onay Gerekli",
description="Şartları kabul ediyor musunuz?",
color=0x3498DB
)
row = jubbio.ActionRow(
jubbio.Button(style=jubbio.ButtonStyle.SUCCESS, label='Evet', custom_id='btn_yes'),
jubbio.Button(style=jubbio.ButtonStyle.DANGER, label='Hayır', custom_id='btn_no')
)
await message.channel.send(embed=embed, components=[row])
@client.component(custom_id='btn_yes')
async def onaylandi(interaction):
embed = jubbio.Embed(
title="Onaylandı",
description="Teşekkürler, işleminiz onaylandı!",
color=0x2ECC71
)
await interaction.respond(embed=embed, ephemeral=True)
Müzik Botu
import jubbio
from jubbio.voice import join_voice_channel
client = jubbio.Client(
application_id="APP_ID",
intents=jubbio.Intents(jubbio.Intents.GUILDS | jubbio.Intents.GUILD_VOICE_STATES)
)
@client.command(name='oynat')
async def oynat(interaction):
sarki = interaction.get_option("sarki")
channel_id = interaction.member.voice.channel_id
if interaction.guild_id not in client.voice_clients:
vc = await join_voice_channel(client, interaction.guild_id, channel_id)
else:
vc = client.voice_clients[interaction.guild_id]
await vc.player.play(sarki)
embed = jubbio.Embed(
title="Kuyruga Eklendi",
description=f"**{sarki}**",
color=0x2ECC71
)
await interaction.respond(embed=embed)
API Referansı
Client Ana Metotları
| Metot | Ne İşe Yarar? |
|---|---|
client.run(token) |
Botu gateway'e bağlar ve çalıştırır. |
client.register_command(cmd) |
Sunucuya veya globale slash komut kaydeder. |
client.send_dm(user_id, msg) |
Belirtilen kullanıcıya özel mesaj atar. |
client.get_user(user_id) |
Kullanıcı bilgilerini getirir. |
client.get_guild(guild_id) |
Sunucu bilgilerini getirir. |
Ses (Voice) Metotları
| Metot | Ne İşe Yarar? |
|---|---|
join_voice_channel(client, guild_id, channel_id) |
Ses kanalına bağlanır. |
vc.player.play(query) |
Şarkı çalar veya kuyruğa ekler. |
vc.player.skip() |
Şu anki şarkıyı atlar. |
vc.player.stop() |
Müziği durdurur ve kuyruğu temizler. |
vc.destroy() |
Ses bağlantısını kapatır. |
Olaylar (Events)
| Olay | Açıklama |
|---|---|
on_ready |
Bot hazır olduğunda |
on_message(message) |
Yeni mesaj geldiğinde |
on_interaction(interaction) |
Etkileşim olduğunda (Buton, Komut vb.) |
on_guild_join(guild) |
Yeni sunucuya katılınca |
on_guild_remove(guild) |
Sunucudan ayrılınca |
on_member_ban(member) |
Üye yasaklanınca |
on_member_unban(member) |
Yasak kaldırılınca |
on_member_join(member) |
Üye katılınca |
on_member_remove(member) |
Üye ayrılınca |
on_invite_create(invite) |
Davet oluşturulunca |
on_presence_update(data) |
Durum güncellenince |
Bu kütüphane bağımsız geliştiriciler tarafından oluşturulmuştur ve Jubbio Inc. ile doğrudan bağlantısı yoktur.
Project details
Release history Release notifications | RSS feed
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 jubbio_py-1.2.7.tar.gz.
File metadata
- Download URL: jubbio_py-1.2.7.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92b406c033642e2949c478b3b08f1b7e6e44f648125dcf6190257b00d2d64412
|
|
| MD5 |
ac24ed46bfaf5718768375f94f64d791
|
|
| BLAKE2b-256 |
7a6636b6b96e1d5ad106e958fd8994feee1f5c86e7d3dda8e3d29b39fd659b6c
|
File details
Details for the file jubbio_py-1.2.7-py3-none-any.whl.
File metadata
- Download URL: jubbio_py-1.2.7-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67d4437bb42628688d541358334168f093485b8031ddb34b9c93531a456ac475
|
|
| MD5 |
55698e6bfd6b37c360776503f1baba48
|
|
| BLAKE2b-256 |
51e4f9924e452d485b4c6efcc5ad9789e6dbe1fee5fb27de6f049618e6d58879
|