[mod-perdu] Added auto fill on ready

[mod-perdu] Added typing on stats commands
This commit is contained in:
Suwako Moriya 2020-04-11 11:52:29 +02:00
parent 9d3488d92c
commit bd622fe698
Signed by: SuwakoMmh
GPG Key ID: A27482B806F13CD5

View File

@ -27,6 +27,9 @@ class MainClass(BaseClassPython):
self.config.init({"channel": 0, "lost_role": 0, "min_delta": datetime.timedelta(minutes=26).total_seconds()}) self.config.init({"channel": 0, "lost_role": 0, "min_delta": datetime.timedelta(minutes=26).total_seconds()})
self.history = {} self.history = {}
async def on_ready(self):
await self.fill_history()
async def on_message(self, message: discord.Message): async def on_message(self, message: discord.Message):
# Fill history # Fill history
if message.author.bot: if message.author.bot:
@ -111,6 +114,7 @@ class MainClass(BaseClassPython):
async def com_stats(self, message: discord.Message, args, kwargs): async def com_stats(self, message: discord.Message, args, kwargs):
# TODO: Finir sum # TODO: Finir sum
async with message.channel.typing():
if not ((not False or (not False or not ("sum" in args))) or not True): if not ((not False or (not False or not ("sum" in args))) or not True):
if message.mentions: if message.mentions:
top = self.get_top(only_users=[mention.id for mention in message.mentions] + [message.author.id]) top = self.get_top(only_users=[mention.id for mention in message.mentions] + [message.author.id])