From 2e78787a25e8865164b255bf5ec13fe7003821bb Mon Sep 17 00:00:00 2001 From: Mole1424 Date: Sun, 31 Mar 2024 23:09:03 +0000 Subject: [PATCH] removed channel scrape --- cogs/commands/misc.py | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/cogs/commands/misc.py b/cogs/commands/misc.py index a90ed96..5f7de36 100644 --- a/cogs/commands/misc.py +++ b/cogs/commands/misc.py @@ -1,11 +1,7 @@ import random -import tempfile -from discord import File from discord.ext import commands -from discord.ext.commands import Bot, Context, check - -from utils import is_compsoc_exec_in_guild +from discord.ext.commands import Bot, Context class Misc(commands.Cog): @@ -128,30 +124,6 @@ async def babbage(self, ctx: Context): "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ) - @commands.hybrid_command() - @check(is_compsoc_exec_in_guild) - async def scrapegeneral(self, ctx: Context): - # get general channel by id - general = ctx.guild.get_channel(189453139584221185) - # get all messages and send as txt file - messages = [] - numfiles = 0 - async for message in general.history(limit=None): - messages.append(message.content) - if len(messages) % 10000 == 0: - await ctx.send(f"Scraped {len(messages)}/~288,993s messages") - with tempfile.NamedTemporaryFile(mode="w", delete=False) as f: - f.write("\n".join(messages)) - file = File(f.name, filename=f"general{numfiles}.txt") - numfiles += 1 - await ctx.send(file=file) - messages = [] - with tempfile.NamedTemporaryFile(mode="w", delete=False) as f: - f.write("\n".join(messages)) - file = File(f.name, filename=f"general{numfiles}.txt") - await ctx.send(file=file) - return await ctx.send("Scraped all messages :)") - async def setup(bot: Bot): await bot.add_cog(Misc(bot))