Official Python SDK for KOREANBOTS
문서
예제
discord.py의 tasks를 이용해 서버 수를 1시간마다 자동으로 업데이트하는 예제입니다.
import discord
from discord.ext import commands, tasks
from koreanbots import Koreanbots
BOT_TOKEN = "your_discord_bot_token"
KOREANBOTS_API_KEY = "your_koreanbots_api_key"
bot = commands.Bot(command_prefix="!", intents=discord.Intents.default())
koreanbots = Koreanbots(KOREANBOTS_API_KEY)
@tasks.loop(hours=1)
async def update_server_count():
await koreanbots.update_bot_info(
bot_id=bot.user.id,
servers=len(bot.guilds),
shards=bot.shard_count or 0,
)
@update_server_count.before_loop
async def before_update_server_count():
await bot.wait_until_ready()
@bot.event
async def on_ready():
update_server_count.start()
print(f"Logged in as {bot.user}")
bot.run(BOT_TOKEN)
Metadata
Release files for koreanbots 4.0.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 | |
|---|---|---|---|
| koreanbots-4.0.0.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| koreanbots-4.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.3 kB
Release files / koreanbots-4.0.0.tar.gz
| Download URL | koreanbots-4.0.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d71e041579e07021b96996733df30ec63218397442d8344b2ab4705e89b7358
|
|
BLAKE2b-256 checksum How to use checksums |
4b35f037184a1d76bd7f647fea7780049545e776b6a081e0e16d0f0869f3f044
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Darwin/25.3.0
|
Release files / koreanbots-4.0.0-py3-none-any.whl
| Download URL | koreanbots-4.0.0-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5cbdf963d154278da3aeff98c338e22fbc081c7697f6b791048f39afe1b1b6c
|
|
BLAKE2b-256 checksum How to use checksums |
b45559d496a49964f6d4f9061c518a22ee383263bfcfd56f7ff87a164fb30917
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Darwin/25.3.0
|