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)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
koreanbots-4.0.0.tar.gz
(8.5 kB
view details)
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 koreanbots-4.0.0.tar.gz.
File metadata
- Download URL: koreanbots-4.0.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.1.3 CPython/3.13.3 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d71e041579e07021b96996733df30ec63218397442d8344b2ab4705e89b7358
|
|
| MD5 |
27926b024f25b82af185ad2542eefe3f
|
|
| BLAKE2b-256 |
4b35f037184a1d76bd7f647fea7780049545e776b6a081e0e16d0f0869f3f044
|
File details
Details for the file koreanbots-4.0.0-py3-none-any.whl.
File metadata
- Download URL: koreanbots-4.0.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.1.3 CPython/3.13.3 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5cbdf963d154278da3aeff98c338e22fbc081c7697f6b791048f39afe1b1b6c
|
|
| MD5 |
b666fa24d03696f6a535901b5a65bc47
|
|
| BLAKE2b-256 |
b45559d496a49964f6d4f9061c518a22ee383263bfcfd56f7ff87a164fb30917
|