Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Adam Molnar commited on
massively increase cache limits (10000)
Browse files23 unmodified lines24252627282930420 unmodified lines45145245345445545645723 unmodified linesDISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)intents = discord.Intents.all()bot = commands.Bot(command_prefix='!', intents=intents)logger = logging.getLogger(__name__)logging.basicConfig(level=logging.DEBUG)420 unmodified linesguild = bot.get_guild(879548962464493619)for channel in guild.text_channels: # helps with more accurate logging across restartstry:message_cache.update({m.id: m async for m in channel.history(limit=100)})print(f"Finished caching messages for channel: {channel.name}")except Exception as e:print(f"An error occurred while fetching messages from {channel.name}: {e}")23 unmodified lines24252627282930420 unmodified lines45145245345445545645723 unmodified linesDISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)intents = discord.Intents.all()bot = commands.Bot(command_prefix='!', intents=intents, max_messages=100000)logger = logging.getLogger(__name__)logging.basicConfig(level=logging.DEBUG)420 unmodified linesguild = bot.get_guild(879548962464493619)for channel in guild.text_channels: # helps with more accurate logging across restartstry:message_cache.update({m.id: m async for m in channel.history(limit=10000)})print(f"Finished caching messages for channel: {channel.name}")except Exception as e:print(f"An error occurred while fetching messages from {channel.name}: {e}")
app.py+2-2