diff --git a/config_example.json b/config_example.json index 64717d8..b734391 100644 --- a/config_example.json +++ b/config_example.json @@ -45,6 +45,7 @@ }, "commands": { "rules": "Check out the rules", + "nearby": "Show users near the area", "reapply": "Resubmit the application", "sponsorship": "Apply for sponsor role" }, @@ -65,6 +66,7 @@ "applications": "Retrieve all applications as a JSON" }, "commands_group_destination": { - "warn": "Warn a user" + "warn": "Warn a user", + "nearby": "Show users near the area" } } \ No newline at end of file diff --git a/modules/commands/nearby.py b/modules/commands/nearby.py new file mode 100644 index 0000000..fc0a58b --- /dev/null +++ b/modules/commands/nearby.py @@ -0,0 +1,22 @@ +from app import app +from pyrogram import filters +from modules.utils import configGet, should_quote + +# Nearby command =============================================================================================================== +@app.on_message(~ filters.scheduled & filters.private & filters.chat(configGet("admin_group")) & filters.chat(configGet("destination_group")) & filters.command(["nearby"], prefixes=["/"])) +async def cmd_nearby(app, msg): + await msg.reply_text("Yes, I exist.", quote=should_quote(msg)) + # if not path.exists(f"{configGet('data', 'locations')}{sep}sponsors{sep}{msg.from_user.id}.json"): + # jsonSave(jsonLoad(f"{configGet('data', 'locations')}{sep}sponsor_default.json"), f"{configGet('data', 'locations')}{sep}sponsors{sep}{msg.from_user.id}.json") + # sponsor = jsonLoad(f"{configGet('data', 'locations')}{sep}sponsors{sep}{msg.from_user.id}.json") + # if sponsor["approved"]: + # if sponsor["expires"] is not None: + # if datetime.strptime(sponsor["expires"], "%d.%m.%Y") > datetime.now(): + # await msg.reply_text(f"You have an active sub til **{sponsor['expires']}**.") + # else: + # await msg.reply_text(f"Your sub expired {int((datetime.now()-datetime.strptime(sponsor['expires'], '%d.%m.%Y')).days)} days ago.") + # elif sponsor["approved"]: + # await msg.reply_text(f"Your sub expiration date is not valid.") + # else: + # await msg.reply_text(f"You have no active subscription.") +# ============================================================================================================================== \ No newline at end of file