diff --git a/README.md b/README.md index c5287f6..c74e5d8 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ bot = commands.Bot(command_prefix="!") # Function that will return the current bot's stats. async def get_stats(): - return {"guilds": len(bot.guilds), "shards": 0, "members": len(bot.users)} + return {"servers": len(bot.guilds), "shards": 0, "members": len(bot.users)} # Function that will be called if stats are posted successfully. diff --git a/boticordpy/__init__.py b/boticordpy/__init__.py index 596f461..a850f19 100644 --- a/boticordpy/__init__.py +++ b/boticordpy/__init__.py @@ -10,7 +10,7 @@ __title__ = "boticordpy" __author__ = "Marakarka" __license__ = "MIT" __copyright__ = "Copyright 2021 - 2023 Marakarka" -__version__ = "3.0.0" +__version__ = "3.0.1" from .client import BoticordClient from .types import * diff --git a/boticordpy/client.py b/boticordpy/client.py index 8cf5726..51f4e1d 100644 --- a/boticordpy/client.py +++ b/boticordpy/client.py @@ -54,20 +54,20 @@ class BoticordClient: self, bot_id: typing.Union[str, int], *, - servers: int = 0, - shards: int = 0, - users: int = 0, + servers: typing.Optional[int] = None, + shards: typing.Optional[int] = None, + users: typing.Optional[int] = None, ) -> boticord_types.ResourceBot: """Post Bot's stats. Args: bot_id (Union[:obj:`str`, :obj:`int`]) Id of the bot to post stats of. - servers ( :obj:`int` ) + servers ( Optional[:obj:`int`] ) Bot's servers count - shards ( :obj:`int` ) + shards ( Optional[:obj:`int`] ) Bot's shards count - users ( :obj:`int` ) + users ( Optional[:obj:`int`] ) Bot's users count Returns: @@ -77,7 +77,7 @@ class BoticordClient: _logger.info("Posting bot stats") response = await self.http.post_bot_stats( - bot_id, {"guilds": servers, "shards": shards, "members": users} + bot_id, {"servers": servers, "shards": shards, "members": users} ) return boticord_types.ResourceBot.from_dict(response) diff --git a/boticordpy/http.py b/boticordpy/http.py index 4a62222..e9e15a4 100644 --- a/boticordpy/http.py +++ b/boticordpy/http.py @@ -22,7 +22,7 @@ class HttpClient: def __init__(self, auth_token: str = None, version: int = 3, **kwargs): self.token = auth_token - self.API_URL = f"https://api.boticord.top/v{version}" + self.API_URL = f"https://api.boticord.top/v{version}/" loop = kwargs.get("loop") or asyncio.get_event_loop() diff --git a/boticordpy/websocket.py b/boticordpy/websocket.py index 3b2bb70..977fdc1 100644 --- a/boticordpy/websocket.py +++ b/boticordpy/websocket.py @@ -19,8 +19,7 @@ class BotiCordWebsocket: self.loop = asyncio.get_event_loop() self.ws = None self._listeners = {} - self.not_closed = True - + self.not_closed = False self._token = token def listener(self): diff --git a/docs/source/websocket.rst b/docs/source/websocket.rst index 5fcc5ec..00ec82e 100644 --- a/docs/source/websocket.rst +++ b/docs/source/websocket.rst @@ -17,6 +17,19 @@ BotiCord Websocket Notification types ------------------- -.. function:: comment_removed(data) +.. function:: up_added(data) + + Called when up is added. + +.. function:: comment_added(data) + + Called when comment is added. + +.. function:: comment_edited(data) + + Called when comment is edited. - Called when comment is deleted. \ No newline at end of file +.. function:: comment_removed(data) + + Called when comment is deleted. + diff --git a/examples/autopost.py b/examples/autopost.py index 1239635..57afe50 100644 --- a/examples/autopost.py +++ b/examples/autopost.py @@ -10,7 +10,7 @@ bot = commands.Bot(command_prefix="!") # Function that will return the current bot's stats. async def get_stats(): - return {"guilds": len(bot.guilds), "shards": 0, "members": len(bot.users)} + return {"servers": len(bot.guilds), "shards": 0, "members": len(bot.users)} # Function that will be called if stats are posted successfully.