Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -176,12 +176,13 @@ async def count_messages60(ctx):
|
|
| 176 |
|
| 177 |
|
| 178 |
@bot.command()
|
| 179 |
-
async def
|
| 180 |
if ctx.author.id == 811235357663297546:
|
| 181 |
end_date = datetime.datetime.utcnow() # Current date and time
|
| 182 |
-
start_date = end_date - datetime.timedelta(days=
|
| 183 |
message_count = 0
|
| 184 |
for channel in ctx.guild.text_channels:
|
|
|
|
| 185 |
try:
|
| 186 |
async for message in channel.history(limit=None, after=start_date, before=end_date):
|
| 187 |
message_count += 1
|
|
@@ -189,6 +190,9 @@ async def count_messages90(ctx):
|
|
| 189 |
print(f"Missing access to read messages in {channel.name}")
|
| 190 |
print(f'Total messages between {start_date} and {end_date}: {message_count}')
|
| 191 |
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
""""""
|
| 194 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
|
|
|
| 176 |
|
| 177 |
|
| 178 |
@bot.command()
|
| 179 |
+
async def count_messages(ctx, time: int):
|
| 180 |
if ctx.author.id == 811235357663297546:
|
| 181 |
end_date = datetime.datetime.utcnow() # Current date and time
|
| 182 |
+
start_date = end_date - datetime.timedelta(days=time)
|
| 183 |
message_count = 0
|
| 184 |
for channel in ctx.guild.text_channels:
|
| 185 |
+
print(channel.name)
|
| 186 |
try:
|
| 187 |
async for message in channel.history(limit=None, after=start_date, before=end_date):
|
| 188 |
message_count += 1
|
|
|
|
| 190 |
print(f"Missing access to read messages in {channel.name}")
|
| 191 |
print(f'Total messages between {start_date} and {end_date}: {message_count}')
|
| 192 |
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
|
| 196 |
|
| 197 |
""""""
|
| 198 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|