From 664b12b93109fa316850821ccc6ef675a26bd6fd Mon Sep 17 00:00:00 2001 From: grey-cat-1908 Date: Wed, 28 Jun 2023 10:24:41 +0300 Subject: [PATCH] migration guide --- ACKNOWLEDGEMENTS.txt | 2 +- MIGRATION.md | 60 ++++++++++++++++++++++++++++++++++++++++++++ docs/source/conf.py | 6 ++--- 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 MIGRATION.md diff --git a/ACKNOWLEDGEMENTS.txt b/ACKNOWLEDGEMENTS.txt index b34de64..47958aa 100644 --- a/ACKNOWLEDGEMENTS.txt +++ b/ACKNOWLEDGEMENTS.txt @@ -5,4 +5,4 @@ These are the open source libraries we use: - furo (https://github.com/pradyunsg/furo) It is also important to note that some developments of Melisa (https://github.com/MelisaDev/melisa) were used in the development of the project. -I would also like to express my gratitude to the former admin staff of the BotiCord service (until 06/02/2023) and the entire project community. \ No newline at end of file +I would also like to express my gratitude to the former admin staff of the BotiCord (until 06/02/2023) and the entire project community. \ No newline at end of file diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..d4105f8 --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,60 @@ + +# Migration Guilde + +You can use this guide to make it easier to switch to new version (3x) of boticordpy. + +## Upgrading boticordpy +Run this command in terminal: + +```pip install boticordpy --upgrade``` + +## BoticordClient +With a new BotiCord token system you don't need to specify type of token: + +### Was: +```py +boticord_client = BoticordClient( + "Bot your_api_token", version=2 +) +``` +### Became: +```py +boticord_client = BoticordClient( + "your_api_token", version=3 +) +``` + +You can get a new token in your account settings (not a bot's!) +![Get token here](https://i.ibb.co/wJM7DCq/image.png) + +## Autoposting + +Since the token is no longer connected to the bot you need to specify the ID when starting the autoposting: + +### Was: +```py +autopost = ( + boticord_client.autopost() + .init_stats(get_stats) + .on_success(on_success_posting) + .start() +) +``` +### Became: +```py +autopost = ( + boticord_client.autopost() + .init_stats(get_stats) + .on_success(on_success_posting) + .start("id_of_your_bot") # <--- ID of your bot +) +``` + +## Webhook or websocket... that is the question + +Webhooks are no longer supported in boticordpy. You can find guide how to use boticord websocket [here](https://github.com/boticord/boticordpy/blob/master/examples/websocket.py). + +## Extra changes + +There are some additional changes to the data models and new search methods added. +So, I recommend you to read [the docs](https://py.boticord.top/) \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 88ac24a..3fbfa95 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,12 +22,12 @@ import os sys.path.insert(0, os.path.abspath("../..")) -project = "BoticordPY" -copyright = "2022 - 2023, Viktor K (Marakarka)" +project = "boticordpy" +copyright = "2021 - 2023, Viktor K (Marakarka)" author = "Viktor K (Marakarka)" # The full version, including alpha/beta/rc tags -release = "3.0.0a" +release = "3.0.0" # -- General configuration ---------------------------------------------------