Update agent.py
Browse files
agent.py
CHANGED
|
@@ -231,7 +231,18 @@ class DB:
|
|
| 231 |
a = DB.q("SELECT COUNT(*) c FROM users WHERE last_active>datetime('now','-1 day')", fetchone=True)["c"]
|
| 232 |
return {"total": t, "active": a}
|
| 233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
# ================================================================
|
| 236 |
# LLM SERVICE (all providers + curl for custom)
|
| 237 |
# ================================================================
|
|
|
|
| 231 |
a = DB.q("SELECT COUNT(*) c FROM users WHERE last_active>datetime('now','-1 day')", fetchone=True)["c"]
|
| 232 |
return {"total": t, "active": a}
|
| 233 |
|
| 234 |
+
class Permission:
|
| 235 |
+
@staticmethod
|
| 236 |
+
def is_admin(uid):
|
| 237 |
+
return uid in Config.ADMIN_IDS
|
| 238 |
|
| 239 |
+
@staticmethod
|
| 240 |
+
def is_banned(uid):
|
| 241 |
+
u = DB.get_user(uid)
|
| 242 |
+
if not u:
|
| 243 |
+
return False
|
| 244 |
+
return bool(u["is_banned"])
|
| 245 |
+
|
| 246 |
# ================================================================
|
| 247 |
# LLM SERVICE (all providers + curl for custom)
|
| 248 |
# ================================================================
|