[ChatChart] make channel optional (#124)

also, add concurrency
This commit is contained in:
Fixator10
2020-06-11 00:42:09 +04:00
committed by GitHub
parent dfd4936d79
commit 633f1e0c4b

View File

@@ -7,6 +7,7 @@ import discord
import heapq
import os
from io import BytesIO
from typing import Optional
import matplotlib
matplotlib.use("agg")
@@ -79,7 +80,8 @@ class Chatchart(commands.Cog):
@commands.guild_only()
@commands.command()
@commands.cooldown(1, 10, commands.BucketType.channel)
async def chatchart(self, ctx, channel: discord.TextChannel = None, messages=5000):
@commands.max_concurrency(1, commands.BucketType.channel)
async def chatchart(self, ctx, channel: Optional[discord.TextChannel] = None, messages=5000):
"""
Generates a pie chart, representing the last 5000 messages in the specified channel.
"""