You can use this guide to make it easier to switch to new version (3x) of boticordpy.
Run this command in terminal:
pip install boticordpy --upgrade
With a new BotiCord token system you don't need to specify type of token:
boticord_client = BoticordClient(
"Bot your_api_token", version=2
)
boticord_client = BoticordClient(
"your_api_token", version=3
)
You can get a new token in your account settings (not a bot's!)
Since the token is no longer connected to the bot you need to specify the ID when starting the autoposting:
autopost = (
boticord_client.autopost()
.init_stats(get_stats)
.on_success(on_success_posting)
.start()
)
autopost = (
boticord_client.autopost()
.init_stats(get_stats)
.on_success(on_success_posting)
.start("id_of_your_bot") # <--- ID of your bot
)
Also, JSON's keys for bot stats must be changed:
async def get_stats():
return {"servers": len(bot.guilds), "shards": 0, "users": len(bot.users)}
async def get_stats():
return {"servers": len(bot.guilds), "shards": None, "members": len(bot.users)}
p.s. None of the values must be equal to 0
. Specify None
instead of 0
.
Webhooks are no longer supported in boticordpy. You can find guide how to use boticord websocket here.
There are some additional changes to the data models and new search methods added. So, I recommend you to read the docs