From 95584c0e63656324a82f66b7a328abb6db789850 Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 27 Dec 2024 00:37:54 +0100 Subject: [PATCH 1/3] Slight documentation improvements --- README.md | 22 +++++++++++----------- requirements/dev.txt | 1 + src/libbot/pycord/__init__.py | 2 ++ src/libbot/pyrogram/__init__.py | 2 ++ 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8b281f2..c4b21b4 100644 --- a/README.md +++ b/README.md @@ -36,18 +36,17 @@ pip install libbot[pycord,speed] ### Pyrogram ```python -from libbot.pyrogram import PyroClient +from libbot.pyrogram.classes import PyroClient + def main(): - client = PyroClient(scheduler=scheduler) + client: PyroClient = PyroClient() try: client.run() except KeyboardInterrupt: print("Shutting down...") finally: - if client.scheduler is not None: - client.scheduler.shutdown() exit() @@ -59,20 +58,20 @@ if __name__ == "__main__": ```python from discord import Intents -from libbot import sync -from libbot.pycord import PycordBot +from libbot.utils import config_get +from libbot.pycord.classes import PycordBot async def main(): - intents = Intents.default() - bot = PycordBot(intents=intents) + intents: Intents = Intents.default() + bot: PycordBot = PycordBot(intents=intents) bot.load_extension("cogs") try: - await bot.start(sync.config_get("bot_token", "bot")) + await bot.start(config_get("bot_token", "bot")) except KeyboardInterrupt: - logger.warning("Shutting down...") + print("Shutting down...") await bot.close() @@ -83,4 +82,5 @@ if __name__ == "__main__": ## Config examples -For bot config examples please check the examples directory. Without a valid config file, the bot won't start at all, so you need to make sure the correct config file is used. +For bot config examples please check the examples directory. Without a valid config file, the bot won't start at all, so +you need to make sure the correct config file is used. diff --git a/requirements/dev.txt b/requirements/dev.txt index eef43fd..15173ba 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -7,5 +7,6 @@ pytest-asyncio==0.25.0 pytest-cov==6.0.0 pytest==8.3.4 tox==4.23.2 +twine==6.0.1 types-aiofiles==24.1.0.20241221 types-ujson==5.10.0.20240515 \ No newline at end of file diff --git a/src/libbot/pycord/__init__.py b/src/libbot/pycord/__init__.py index e69de29..def5795 100644 --- a/src/libbot/pycord/__init__.py +++ b/src/libbot/pycord/__init__.py @@ -0,0 +1,2 @@ +# This file is left empty on purpose +# Adding imports here will cause import errors when libbot[pycord] is not installed diff --git a/src/libbot/pyrogram/__init__.py b/src/libbot/pyrogram/__init__.py index e69de29..7e08998 100644 --- a/src/libbot/pyrogram/__init__.py +++ b/src/libbot/pyrogram/__init__.py @@ -0,0 +1,2 @@ +# This file is left empty on purpose +# Adding imports here will cause import errors when libbot[pyrogram] is not installed From d24e94b57e480f29875383a08fb2c98c95169944 Mon Sep 17 00:00:00 2001 From: kku Date: Fri, 27 Dec 2024 18:33:51 +0100 Subject: [PATCH 2/3] Tests are now for 3.11+ --- .gitea/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index a1ba4c6..0fa3d13 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: container: catthehacker/ubuntu:act-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: [ "3.11", "3.12", "3.13" ] steps: - uses: actions/checkout@v3 From 3cdd6da50678868acf557becdc8f00462edb85d7 Mon Sep 17 00:00:00 2001 From: kku Date: Sun, 29 Dec 2024 16:06:45 +0100 Subject: [PATCH 3/3] Added typing_extensions to the dependencies --- requirements/_.txt | 3 ++- src/libbot/__init__.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements/_.txt b/requirements/_.txt index 65e2384..0533664 100644 --- a/requirements/_.txt +++ b/requirements/_.txt @@ -1 +1,2 @@ -aiofiles>=23.0.0 \ No newline at end of file +aiofiles>=23.0.0 +typing_extensions~=4.12.2 \ No newline at end of file diff --git a/src/libbot/__init__.py b/src/libbot/__init__.py index 437481b..ff03163 100644 --- a/src/libbot/__init__.py +++ b/src/libbot/__init__.py @@ -1,4 +1,4 @@ -__version__ = "4.0.0" +__version__ = "4.0.1" __license__ = "GPL3" __author__ = "Profitroll"