summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-04-25 16:58:56 +0100
committerGravatar GitHub <[email protected]>2022-04-25 16:58:56 +0100
commitb8030713bda8dbd0debe620a3a34d7678de7865d (patch)
tree07f81efab424287578ef77499e8e5f0385515db1
parentMerge pull request #68 from python-discord/fix-version-number (diff)
parentSet BotBase.statsd correctly based on init kwargs (diff)
Merge pull request #69 from python-discord/actually-use-statsd_urlv6.3.2
Set BotBase.statsd correctly based on init kwargs
-rw-r--r--CHANGELOG.md3
-rw-r--r--botcore/_bot.py5
-rw-r--r--pyproject.toml2
3 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a2d1dd66..e819feae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog
+## 6.3.2 25th April 2022
+- Fix: Actually use `statsd_url` when it gets passed to `BotBase`.
+
## 6.3.1 21st April 2022
- Fix: Correct version number in pyproject.toml
diff --git a/botcore/_bot.py b/botcore/_bot.py
index 7902d75d..a36dba15 100644
--- a/botcore/_bot.py
+++ b/botcore/_bot.py
@@ -42,6 +42,7 @@ class BotBase(commands.Bot):
http_session: aiohttp.ClientSession,
redis_session: Optional[RedisSession] = None,
api_client: Optional[APIClient] = None,
+ statsd_url: Optional[str] = None,
**kwargs,
):
"""
@@ -53,6 +54,8 @@ class BotBase(commands.Bot):
http_session (aiohttp.ClientSession): The session to use for the bot.
redis_session: The `async_rediscache.RedisSession`_ to use for the bot.
api_client: The :obj:`botcore.site_api.APIClient` instance to use for the bot.
+ statsd_url: The URL of the statsd server to use for the bot. If not given,
+ a dummy statsd client will be created.
.. _async_rediscache.RedisSession: https://github.com/SebastiaanZ/async-rediscache#creating-a-redissession
"""
@@ -65,6 +68,7 @@ class BotBase(commands.Bot):
self.guild_id = guild_id
self.http_session = http_session
self.api_client = api_client
+ self.statsd_url = statsd_url
if redis_session and RedisSession == discord.utils._MissingSentinel:
warnings.warn("redis_session kwarg passed, but async-rediscache not installed!")
@@ -74,7 +78,6 @@ class BotBase(commands.Bot):
self._resolver: Optional[aiohttp.AsyncResolver] = None
self._connector: Optional[aiohttp.TCPConnector] = None
- self.statsd_url: Optional[str] = None
self._statsd_timerhandle: Optional[asyncio.TimerHandle] = None
self._guild_available: Optional[asyncio.Event] = None
diff --git a/pyproject.toml b/pyproject.toml
index a6f5868a..43a214a0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "bot-core"
-version = "6.3.1"
+version = "6.3.2"
description = "Bot-Core provides the core functionality and utilities for the bots of the Python Discord community."
authors = ["Python Discord <[email protected]>"]
license = "MIT"