mirror of
https://github.com/boticord/boticordpy.git
synced 2024-09-23 03:42:01 +03:00
26 lines
611 B
Python
26 lines
611 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)
|
||
|
)
|
||
|
|
||
|
bot.run("bot token")
|