mirror of
https://github.com/boticord/boticordpy.git
synced 2024-11-14 12:27:28 +03:00
26 lines
624 B
Python
26 lines
624 B
Python
# You can use disnake or nextcord or something like this.
|
|
# (THIS EXAMPLE IS NOT TESTED. IF YOU HAVE ANY PROBLEMS - ASK DEVELOPER PLEASE)
|
|
|
|
from discord.ext import commands
|
|
|
|
from boticordpy import BoticordClient
|
|
|
|
bot = commands.Bot(command_prefix="!")
|
|
|
|
|
|
async def get_stats():
|
|
return {"servers": len(bot.guilds), "shards": 0, "users": len(bot.users)}
|
|
|
|
|
|
async def on_success_posting():
|
|
print("stats posting successfully")
|
|
|
|
boticord_client = BoticordClient("your_api_token")
|
|
autopost = (
|
|
boticord_client.autopost()
|
|
.init_stats(get_stats)
|
|
.on_success(on_success_posting)
|
|
.start()
|
|
)
|
|
|
|
bot.run("bot token")
|