diff --git a/exts/fun.py b/exts/fun.py index b08bb05..6521079 100644 --- a/exts/fun.py +++ b/exts/fun.py @@ -80,22 +80,22 @@ class Fun: a = a * (i + 1) return a - # @commands.command() - # @commands.cooldown(1, 5, type=commands.BucketType.user) - # async def fact(self, ctx, number:int): - # if number < 20001 and number > 0: - # n = 1990 - # with ctx.channel.typing(): - # a = await self.bot.loop.run_in_executor(None, self.get_factorial, number) - # if len(str(a)) > 6000: - # for b in [str(a)[i:i+n] for i in range(0, len(str(a)), n)]: - # await ctx.author.send(f'```py\n{b}```') - # await ctx.send(f"{ctx.author.mention} Check your DMs.") - # else: - # for b in [str(a)[i:i+n] for i in range(0, len(str(a)), n)]: - # await ctx.send(f'```py\n{b}```') - # else: - # await ctx.send("Invalid number. Please enter a number between 0 and 20,000") + @commands.command() + @commands.cooldown(1, 5, type=commands.BucketType.user) + async def fact(self, ctx, number:int): + if number < 20001 and number > 0: + n = 1990 + with ctx.channel.typing(): + a = await self.bot.loop.run_in_executor(None, self.get_factorial, number) + if len(str(a)) > 6000: + for b in [str(a)[i:i+n] for i in range(0, len(str(a)), n)]: + await ctx.author.send(f'```py\n{b}```') + await ctx.send(f"{ctx.author.mention} Check your DMs.") + else: + for b in [str(a)[i:i+n] for i in range(0, len(str(a)), n)]: + await ctx.send(f'```py\n{b}```') + else: + await ctx.send("Invalid number. Please enter a number between 0 and 20,000") @commands.command(hidden=True) @commands.is_owner() @@ -153,9 +153,9 @@ class Fun: trans = await self.bot.db_con.fetchval('select code from geeksbot_emojis where id = 405943174809255956') msg = await ctx.send(f'{member.mention}{trans*20}{self.bot.unicode_emojis["left_fist"]}') - for i in range(21): + for i in range(4): await asyncio.sleep(0.1) - await msg.edit(content=f'{member.mention}{trans*(20-i)}{self.bot.unicode_emojis["left_fist"]}') + await msg.edit(content=f'{member.mention}{trans*(20-(i*5))}{self.bot.unicode_emojis["left_fist"]}') await asyncio.sleep(0.1) await msg.edit(content=f'{self.bot.unicode_emojis["boom"]}') await asyncio.sleep(0.5) diff --git a/geeksbot.py b/geeksbot.py index c1a28cf..a4f9822 100644 --- a/geeksbot.py +++ b/geeksbot.py @@ -5,8 +5,6 @@ import logging from datetime import datetime import json import aiohttp -from postgres import Postgres -from collections import deque from googleapiclient.discovery import build import asyncpg from concurrent import futures @@ -157,8 +155,6 @@ async def on_message(ctx): async def on_ready(): if bot.db_con is None: await bot.connect_db() bot.recent_msgs = {} - for guild in bot.guilds: - bot.recent_msgs[guild.id] = deque(maxlen=50) logging.info('Logged in as {0.name}|{0.id}'.format(bot.user)) load_list = bot.bot_config['load_list'] for load_item in load_list: