diff options
| author | 2020-05-14 16:58:55 +0300 | |
|---|---|---|
| committer | 2020-05-14 16:58:55 +0300 | |
| commit | 206aed70f6185057ccbe4f8478ed456e5ab0c197 (patch) | |
| tree | b7a7fcd5d4fdca9e5918d7891acc97e8b6f00768 | |
| parent | Merge pull request #899 from ks129/python-news (diff) | |
Python News: Implement stats
Add stat increaser to PEP and maillist posting.
| -rw-r--r-- | bot/cogs/python_news.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bot/cogs/python_news.py b/bot/cogs/python_news.py index 57ce61638..d28af4a0b 100644 --- a/bot/cogs/python_news.py +++ b/bot/cogs/python_news.py @@ -109,6 +109,9 @@ class PythonNews(Cog): ) payload["data"]["pep"].append(pep_nr) + # Increase overall PEP new stat + self.bot.stats.incr("python_news.posted.pep") + if msg.channel.is_news(): log.trace("Publishing PEP annnouncement because it was in a news channel") await msg.publish() @@ -168,6 +171,9 @@ class PythonNews(Cog): ) payload["data"][maillist].append(thread_information["thread_id"]) + # Increase this specific maillist counter in stats + self.bot.stats.incr(f"python_news.posted.{maillist.replace('-', '_')}") + if msg.channel.is_news(): log.trace("Publishing mailing list message because it was in a news channel") await msg.publish() |