Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
massively increase cache limits (10000)
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def convert_to_timezone(dt, tz):
|
|
24 |
|
25 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
26 |
intents = discord.Intents.all()
|
27 |
-
bot = commands.Bot(command_prefix='!', intents=intents)
|
28 |
|
29 |
logger = logging.getLogger(__name__)
|
30 |
logging.basicConfig(level=logging.DEBUG)
|
@@ -451,7 +451,7 @@ async def on_ready():
|
|
451 |
guild = bot.get_guild(879548962464493619)
|
452 |
for channel in guild.text_channels: # helps with more accurate logging across restarts
|
453 |
try:
|
454 |
-
message_cache.update({m.id: m async for m in channel.history(limit=
|
455 |
print(f"Finished caching messages for channel: {channel.name}")
|
456 |
except Exception as e:
|
457 |
print(f"An error occurred while fetching messages from {channel.name}: {e}")
|
|
|
24 |
|
25 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
26 |
intents = discord.Intents.all()
|
27 |
+
bot = commands.Bot(command_prefix='!', intents=intents, max_messages=100000)
|
28 |
|
29 |
logger = logging.getLogger(__name__)
|
30 |
logging.basicConfig(level=logging.DEBUG)
|
|
|
451 |
guild = bot.get_guild(879548962464493619)
|
452 |
for channel in guild.text_channels: # helps with more accurate logging across restarts
|
453 |
try:
|
454 |
+
message_cache.update({m.id: m async for m in channel.history(limit=10000)})
|
455 |
print(f"Finished caching messages for channel: {channel.name}")
|
456 |
except Exception as e:
|
457 |
print(f"An error occurred while fetching messages from {channel.name}: {e}")
|