diff options
| author | 2020-07-15 07:33:48 +0200 | |
|---|---|---|
| committer | 2020-07-15 07:33:48 +0200 | |
| commit | ed6d848e3cd5cf355b9702e9c8df08c063c11a47 (patch) | |
| tree | 323278a0a4e2289b9c843b815afda041053594b8 | |
| parent | Add the user ID to the username in dm relays. (diff) | |
Add some stats for DMs sent and received.
https://github.com/python-discord/bot/issues/1041
| -rw-r--r-- | bot/cogs/dm_relay.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/cogs/dm_relay.py b/bot/cogs/dm_relay.py index d3637d34b..edfcccf6d 100644 --- a/bot/cogs/dm_relay.py +++ b/bot/cogs/dm_relay.py @@ -48,10 +48,12 @@ class DMRelay(Cog): if member: await member.send(message) await ctx.message.add_reaction("✅") + self.bot.stats.incr("dm_relay.dm_sent") return elif last_dm_user: await last_dm_user.send(message) await ctx.message.add_reaction("✅") + self.bot.stats.incr("dm_relay.dm_sent") return else: log.debug("This bot has never gotten a DM, or the RedisCache has been cleared.") @@ -84,6 +86,7 @@ class DMRelay(Cog): avatar_url=message.author.avatar_url ) await self.dm_cache.set("last_user", message.author.id) + self.bot.stats.incr("dm_relay.dm_received") # Handle any attachments if message.attachments: |