Commented import of the event
This commit is contained in:
parent
c7037ae246
commit
09e3c23c4f
@ -15,7 +15,8 @@ from modules import custom_filters
|
||||
from modules.database import col_applications, col_sponsorships, col_warnings
|
||||
from modules.logging import logWrite
|
||||
from modules.utils import locale, should_quote
|
||||
from modules.event import col_event
|
||||
|
||||
# from modules.event import col_event
|
||||
|
||||
|
||||
@app.on_message(
|
||||
@ -34,7 +35,13 @@ async def cmd_export(app: Client, msg: Message):
|
||||
|
||||
selection = msg.command[1].lower()
|
||||
|
||||
if selection not in ["applications", "warnings", "sponsorships", "bans", "event"]:
|
||||
if selection not in [
|
||||
"applications",
|
||||
"warnings",
|
||||
"sponsorships",
|
||||
"bans",
|
||||
# "event",
|
||||
]:
|
||||
await msg.reply_text(
|
||||
locale("syntax_export", "message", locale=msg.from_user),
|
||||
quote=should_quote(msg),
|
||||
@ -146,14 +153,14 @@ async def cmd_export(app: Client, msg: Message):
|
||||
output_json.append(entry)
|
||||
output_csv.append(entry)
|
||||
|
||||
elif selection == "event":
|
||||
header_csv = ["user", "stage", "date"]
|
||||
# elif selection == "event":
|
||||
# header_csv = ["user", "stage", "date"]
|
||||
|
||||
for entry in list(col_event.find()):
|
||||
del entry["_id"]
|
||||
entry["date"] = entry["date"].isoformat()
|
||||
output_json.append(entry)
|
||||
output_csv.append(entry)
|
||||
# for entry in list(col_event.find()):
|
||||
# del entry["_id"]
|
||||
# entry["date"] = entry["date"].isoformat()
|
||||
# output_json.append(entry)
|
||||
# output_csv.append(entry)
|
||||
|
||||
# Saving CSV
|
||||
async with aiofiles.open(temp_file + ".csv", mode="w", encoding="utf-8") as file:
|
||||
|
Reference in New Issue
Block a user