Compare commits
10 Commits
fe039d3923
...
16bbff1bf8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16bbff1bf8 | ||
|
|
127f8a032f | ||
|
|
1fdaf4dd6c | ||
|
|
420b17bfb7 | ||
|
|
c04833d372 | ||
|
|
145a429f15 | ||
|
|
7e4c4d9100 | ||
|
|
d5985aa102 | ||
|
|
a2f113a35f | ||
|
|
7c3ef0d5a5 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -49,6 +49,7 @@ build/
|
||||
|
||||
# Ignore node_modules
|
||||
node_modules/
|
||||
package-lock.json
|
||||
|
||||
# Ignore Next.js build output
|
||||
.next/
|
||||
|
||||
486
PROJEKT_ANALYSE.md
Normal file
486
PROJEKT_ANALYSE.md
Normal file
@@ -0,0 +1,486 @@
|
||||
# Security Assessment Report
|
||||
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
| **Report ID** | ZYROX-SEC-2026-001 |
|
||||
| **Target** | ZyroX CV2 AIO Discord Bot with Dashboard |
|
||||
| **Repository** | `ZyroX-CV2-AIO-With-Dashboard-main` |
|
||||
| **Assessment Date** | 2026-07-21 |
|
||||
| **Report Version** | 1.0 |
|
||||
| **Classification** | Internal — Distribution Restricted |
|
||||
| **Assessment Type** | Static source-code review, configuration analysis, threat modeling |
|
||||
| **Assessor** | Independent security review (automated + manual verification) |
|
||||
|
||||
---
|
||||
|
||||
## Document Control
|
||||
|
||||
| Version | Date | Author | Changes |
|
||||
|---------|------|--------|---------|
|
||||
| 1.0 | 2026-07-21 | Security Review | Initial assessment |
|
||||
|
||||
**Scope:** Full repository including `bot/` (Python/discord.py), `bot/api/` (FastAPI), and `dashboard/` (Next.js). Out of scope: runtime penetration testing, infrastructure review, third-party Lavalink/OpenAI endpoints.
|
||||
|
||||
**Methodology:**
|
||||
1. Recursive static analysis of source tree (~200+ Python/TypeScript files)
|
||||
2. Configuration default and `.env.example` review
|
||||
3. Identification of trust boundaries (Discord ↔ Bot ↔ API ↔ Dashboard ↔ Internet)
|
||||
4. Mapping findings to [CWE](https://cwe.mitre.org/) where applicable
|
||||
5. Severity assignment per internal scale (Critical → Informational)
|
||||
|
||||
**Limitations:** This assessment reflects the codebase state at review time. No dynamic exploitation was performed against a live deployment. Residual risk may exist in unreviewed dependencies.
|
||||
|
||||
---
|
||||
|
||||
## 1. Executive Summary
|
||||
|
||||
A security review of the ZyroX CV2 AIO Discord bot (originally published by CodeX Devs) was conducted to determine whether the repository contains malicious code and to identify exploitable misconfigurations.
|
||||
|
||||
### 1.1 Malware Classification
|
||||
|
||||
| Indicator | Result |
|
||||
|-----------|--------|
|
||||
| Known malware signatures (trojan, RAT, cryptominer, token stealer) | Not observed |
|
||||
| Obfuscated or packed payloads | Not observed |
|
||||
| Committed binary artifacts (`.exe`, `.dll`, `.sh`) | None |
|
||||
| Covert C2 / unknown outbound endpoints | Not observed |
|
||||
| Intentional third-party control primitives | **Confirmed** (see Findings) |
|
||||
|
||||
**Verdict:** The codebase does **not** exhibit characteristics of traditional malware. However, **default configuration and hardcoded identifiers create effective pre-positioned access** for third parties if an operator deploys without modification. This pattern is classified as **latent supply-chain / configuration backdoor risk**, not as a self-propagating trojan.
|
||||
|
||||
### 1.2 Risk Overview
|
||||
|
||||
| Severity | Count | Representative Issues |
|
||||
|----------|-------|---------------------|
|
||||
| Critical | 3 | Hardcoded owner fallback, Jishaku RCE, command telemetry webhook |
|
||||
| High | 3 | Hardcoded log channels, exposed API surface, client-side API key |
|
||||
| Medium | 3 | `eval()` usage, runtime package/binary fetch, deceptive commands |
|
||||
| Low | 1 | Developer branding / optional telemetry hooks |
|
||||
| **Total** | **10** | |
|
||||
|
||||
**Operational impact if deployed with defaults:** A third-party Discord account retains bot owner privileges; command metadata and guild join events may be exfiltrated to external Discord channels/webhooks; owner-level Jishaku access enables host-level code execution.
|
||||
|
||||
---
|
||||
|
||||
## 2. System Overview & Attack Surface
|
||||
|
||||
### 2.1 Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Trust Boundary │
|
||||
Discord Users ───►│ discord.py Gateway (bot/CodeX.py) │
|
||||
│ │ │ │
|
||||
│ ▼ ▼ │
|
||||
│ SQLite (bot/db/) FastAPI :8000 │
|
||||
│ │ │
|
||||
Web Users ───────►│ Next.js Dashboard :3000 ◄┘ │
|
||||
│ │ │
|
||||
│ ▼ (optional) │
|
||||
│ Cloudflare Tunnel → Internet │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### 2.2 Trust Boundaries
|
||||
|
||||
| Boundary | Authentication | Authorization Gap (pre-remediation) |
|
||||
|----------|----------------|-------------------------------------|
|
||||
| Discord → Bot | Discord token, owner ID list | Owner list defaulted to third party |
|
||||
| Bot → External webhooks/channels | None (hardcoded destinations) | Unauthenticated telemetry sink |
|
||||
| Dashboard → Bot API | Bearer `DASHBOARD_API_KEY` | No Discord permission binding |
|
||||
| Browser → Dashboard API | OAuth session (partial) | API key embedded in client bundle |
|
||||
| Internet → FastAPI | API key only when tunnel enabled | Binds `0.0.0.0` by default |
|
||||
|
||||
### 2.3 Expanded Attack Surface
|
||||
|
||||
Beyond a typical Discord bot, this project includes:
|
||||
|
||||
| Component | Path | Notes |
|
||||
|-----------|------|-------|
|
||||
| Web dashboard | `dashboard/` | OAuth, guild configuration UI |
|
||||
| REST API | `bot/api/` | Full guild config CRUD |
|
||||
| Cloudflare tunnel | `bot/utils/tunnel.py` | Optional public exposure |
|
||||
| Lavalink integration | `bot/cogs/commands/music.py` | External dependency |
|
||||
| AI modules | `bot/cogs/commands/ai.py` | External API calls |
|
||||
| Embedded games/utilities | `bot/games/`, various cogs | Expanded code surface |
|
||||
|
||||
These components are **in scope for the product design** but increase exposure relative to a minimal bot.
|
||||
|
||||
---
|
||||
|
||||
## 3. Detailed Findings
|
||||
|
||||
Findings are indexed as `ZYROX-2026-NNN`. Severity uses: **Critical**, **High**, **Medium**, **Low**, **Informational**.
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-001 — Hardcoded Owner ID Fallback
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | Critical |
|
||||
| **CWE** | [CWE-1188](https://cwe.mitre.org/data/definitions/1188.html) — Insecure Default Initialization of Resource |
|
||||
| **CVSS 3.1 (est.)** | 9.1 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
|
||||
| **Status at review** | Open → Remediated in `SECURITY_FIXES.md` (#1) |
|
||||
|
||||
**Affected component:** `bot/utils/config.py`
|
||||
|
||||
**Description:** When `OWNER_IDS` is absent from environment configuration, the bot falls back to a hardcoded Discord snowflake belonging to the original maintainer.
|
||||
|
||||
```python
|
||||
OWNER_IDS: list[int] = _parse_ids("OWNER_IDS", [870179991462236170])
|
||||
```
|
||||
|
||||
**Impact:** Unconfigured deployments grant **full bot owner privileges** to UID `870179991462236170`, including process restart (`reload`), cross-guild moderation, global blacklist, invite generation, and access to Jishaku (Finding 002).
|
||||
|
||||
**Evidence:** `bot/utils/config.py`; additional third-party IDs present in `bot/.env.example`.
|
||||
|
||||
**Owner-capable commands (non-exhaustive):** `reload`, `leaveguild`, `makeinvite`, `GB`, `global kick`, `global timeout`, `blacklist user/guild`.
|
||||
|
||||
**Remediation:**
|
||||
- Remove hardcoded fallback; fail closed or warn when `OWNER_IDS` is empty
|
||||
- Replace example IDs with placeholders
|
||||
- Operator must set `OWNER_IDS=<own_discord_id>`
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-002 — Jishaku Extension Enabled by Default
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | Critical |
|
||||
| **CWE** | [CWE-78](https://cwe.mitre.org/data/definitions/78.html) / [CWE-94](https://cwe.mitre.org/data/definitions/94.html) |
|
||||
| **CVSS 3.1 (est.)** | 9.8 (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) |
|
||||
| **Status at review** | Open → Remediated (#2) |
|
||||
|
||||
**Affected component:** `bot/CodeX.py` (~L345)
|
||||
|
||||
```python
|
||||
await client.load_extension("jishaku")
|
||||
```
|
||||
|
||||
**Description:** [Jishaku](https://github.com/Gorialis/jishaku) provides an in-Discord Python REPL restricted to bot owners. Any principal in `OWNER_IDS` can execute arbitrary Python on the host process.
|
||||
|
||||
**Impact:** Full host compromise under owner account compromise or misconfigured `OWNER_IDS` (chained with Finding 001).
|
||||
|
||||
**Remediation:** Load Jishaku only when `JISHAKU_ENABLED=true`; default `false`. Never enable in production.
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-003 — Command Telemetry via Discord Webhook
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | Critical |
|
||||
| **CWE** | [CWE-359](https://cwe.mitre.org/data/definitions/359.html) — Exposure of Private Personal Information |
|
||||
| **CVSS 3.1 (est.)** | 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) |
|
||||
| **Status at review** | Open → Remediated (#3) |
|
||||
|
||||
**Affected component:** `bot/CodeX.py` → `on_command_completion`
|
||||
|
||||
**Description:** Non-owner command invocations are POSTed to `CMD_WEBHOOK_URL` with command text, user ID, guild name/ID, and channel ID. Owner commands are explicitly excluded from logging.
|
||||
|
||||
**Impact:** Webhook controller receives **cross-guild activity intelligence**. Privacy violation; potential GDPR relevance depending on jurisdiction.
|
||||
|
||||
**Remediation:** Disable by default; validate URL before enabling; use operator-controlled webhook only.
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-004 — Hardcoded Discord Channel IDs for Telemetry
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | High |
|
||||
| **CWE** | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) — Use of Hard-coded Credentials (analogous) |
|
||||
| **Status at review** | Open → Remediated (#4) |
|
||||
|
||||
**Affected components:**
|
||||
|
||||
| File | Channel ID | Function |
|
||||
|------|------------|----------|
|
||||
| `bot/CodeX.py` | `1396794297386532978` | Guild join notifications |
|
||||
| `bot/CodeX.py` | `1419729255977189467` | Server count display |
|
||||
| `bot/CodeX.py` | `1419729283861184632` | Member count display |
|
||||
| `bot/cogs/events/on_guild.py` | `1396794297386532978` | Join/leave detail logs |
|
||||
| `bot/cogs/commands/np.py` | `1396794297386532978` | No-prefix command audit |
|
||||
|
||||
**Impact:** Guild metadata (name, owner, member count, invite links) transmitted to channels controlled by the original developer.
|
||||
|
||||
**Remediation:** Externalize to `LOG_CHANNEL_ID`, `SERVER_COUNT_CHANNEL_ID`, `USER_COUNT_CHANNEL_ID`; no logging when unset.
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-005 — Over-Exposed FastAPI with Optional Public Tunnel
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | High |
|
||||
| **CWE** | [CWE-284](https://cwe.mitre.org/data/definitions/284.html) — Improper Access Control |
|
||||
| **Status at review** | Open → Partially remediated (#5, #10) |
|
||||
|
||||
**Affected components:** `bot/api/server.py`, `bot/utils/tunnel.py`, `bot/CodeX.py`
|
||||
|
||||
**Description:** API listens on `0.0.0.0:8000` by default. Cloudflare tunnel can expose localhost to the public internet. Authentication is a single shared bearer token without per-guild Discord authorization (pre-fix).
|
||||
|
||||
**Sensitive endpoints (sample):**
|
||||
- `PATCH /api/v1/guilds/{id}/automod`
|
||||
- `PATCH /api/v1/guilds/{id}/antinuke`
|
||||
- `PATCH /api/v1/guilds/{id}/verification`
|
||||
- `PATCH /api/v1/admin/config`
|
||||
|
||||
**Impact:** API key compromise → full configuration manipulation across all guilds.
|
||||
|
||||
**Remediation:** Default `API_ENABLED=false`, `API_HOST=127.0.0.1`, `TUNNEL_ENABLED=false`; bind Discord OAuth token + guild admin checks (Fix #10).
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-006 — API Key Embedded in Client Bundle
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | High |
|
||||
| **CWE** | [CWE-522](https://cwe.mitre.org/data/definitions/522.html) — Insufficiently Protected Credentials |
|
||||
| **Status at review** | Open → Remediated (#6) |
|
||||
|
||||
**Affected component:** `dashboard/lib/api.ts`
|
||||
|
||||
```typescript
|
||||
const API_KEY = process.env.NEXT_PUBLIC_DASHBOARD_API_KEY;
|
||||
```
|
||||
|
||||
**Description:** Next.js inlines `NEXT_PUBLIC_*` variables into client JavaScript. Any dashboard visitor can extract the bearer token.
|
||||
|
||||
**Impact:** Unauthenticated API access if combined with reachable bot API (Finding 005).
|
||||
|
||||
**Remediation:** Server-side proxy route; `DASHBOARD_API_KEY` server-only; remove `NEXT_PUBLIC_DASHBOARD_API_KEY`.
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-007 — Unsafe Dynamic Code Evaluation (`eval`)
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | Medium |
|
||||
| **CWE** | [CWE-95](https://cwe.mitre.org/data/definitions/95.html) — Improper Neutralization of Directives in Eval |
|
||||
| **Status at review** | Open → Remediated (#7) |
|
||||
|
||||
**Affected components:**
|
||||
|
||||
| File | Line(s) | Context |
|
||||
|------|---------|---------|
|
||||
| `bot/cogs/commands/calc.py` | 92 | User-supplied expression |
|
||||
| `bot/cogs/commands/autorole.py` | 235, 268, 306, 339 | DB-persisted list parsing |
|
||||
|
||||
**Impact:** Local RCE if an attacker can write SQLite records or abuse calculator input validation gaps.
|
||||
|
||||
**Remediation:** AST-limited math evaluator; JSON/`ast.literal_eval` for structured data.
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-008 — Runtime Dependency Installation & Binary Fetch
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | Medium |
|
||||
| **CWE** | [CWE-829](https://cwe.mitre.org/data/definitions/829.html) — Inclusion of Functionality from Untrusted Control Sphere |
|
||||
| **Status at review** | Open → Remediated (#8) |
|
||||
|
||||
**Affected components:** `bot/utils/tunnel.py`, `bot/utils/paginators.py`
|
||||
|
||||
**Description:** Application invokes `pip install` via `os.system` and downloads `cloudflared` from GitHub at runtime.
|
||||
|
||||
**Impact:** Supply-chain compromise if upstream artifact is tampered; violates principle of immutable deployments.
|
||||
|
||||
**Remediation:** Declare dependencies in `requirements.txt`; opt-in binary download via `TUNNEL_ALLOW_BINARY_DOWNLOAD=true`.
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-009 — Deceptive User-Facing Commands
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | Medium (Social Engineering) |
|
||||
| **CWE** | [CWE-451](https://cwe.mitre.org/data/definitions/451.html) — User Interface (UI) Misrepresentation of Critical Information |
|
||||
| **Status at review** | Open → Remediated (#9) |
|
||||
|
||||
**Affected component:** `bot/cogs/commands/general.py`
|
||||
|
||||
| Command | Behavior | Actual harm |
|
||||
|---------|----------|-------------|
|
||||
| `hack @user` | Fabricated credentials | None |
|
||||
| `token @user` | Random 59-char string | None |
|
||||
| `wizz` | Simulated destruction UI | None |
|
||||
|
||||
**Impact:** No technical exploitation; reputational and social-engineering risk.
|
||||
|
||||
**Remediation:** Remove or clearly label as parody commands.
|
||||
|
||||
---
|
||||
|
||||
### ZYROX-2026-010 — Developer Branding & Dormant Telemetry Hooks
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Severity** | Low / Informational |
|
||||
| **Status at review** | Acknowledged — no code change required |
|
||||
|
||||
**Description:** >100 files contain CodeX branding headers (`discord.gg/codexdev`). Commented `autoblacklist` cog references external support channel. Help footers link to developer Discord.
|
||||
|
||||
**Impact:** No direct exploitation path; increases fingerprinting and social-trust surface.
|
||||
|
||||
---
|
||||
|
||||
## 4. Finding Summary Matrix
|
||||
|
||||
| ID | Title | Severity | Exploitability | Data Impact | Remediation Priority |
|
||||
|----|-------|----------|----------------|-------------|---------------------|
|
||||
| ZYROX-2026-001 | Hardcoded owner fallback | Critical | Trivial (default deploy) | Full bot control | P0 |
|
||||
| ZYROX-2026-002 | Jishaku RCE | Critical | Requires owner access | Host compromise | P0 |
|
||||
| ZYROX-2026-003 | Command webhook telemetry | Critical | Passive (default URL) | User/guild metadata | P0 |
|
||||
| ZYROX-2026-004 | Hardcoded log channels | High | Passive | Guild intelligence | P1 |
|
||||
| ZYROX-2026-005 | Exposed FastAPI + tunnel | High | Requires key/network | Config takeover | P1 |
|
||||
| ZYROX-2026-006 | Client-exposed API key | High | Trivial (view source) | Config takeover | P1 |
|
||||
| ZYROX-2026-007 | eval() injection | Medium | Conditional | Local RCE | P2 |
|
||||
| ZYROX-2026-008 | Runtime pip/binary fetch | Medium | Supply-chain | Integrity | P2 |
|
||||
| ZYROX-2026-009 | Deceptive commands | Medium | Social | None (technical) | P2 |
|
||||
| ZYROX-2026-010 | Branding / telemetry hooks | Low | N/A | N/A | P3 |
|
||||
|
||||
---
|
||||
|
||||
## 5. Pre-Deployment Checklist (Operator)
|
||||
|
||||
### P0 — Before first production start
|
||||
|
||||
- [ ] Set `OWNER_IDS` to operator-controlled Discord account(s)
|
||||
- [ ] Verify no third-party IDs in `.env` or `.env.example`
|
||||
- [ ] Confirm `JISHAKU_ENABLED` is unset or `false`
|
||||
- [ ] Leave `CMD_WEBHOOK_URL` empty unless operator-owned
|
||||
- [ ] Replace or unset all hardcoded log channel IDs
|
||||
|
||||
### P1 — Before exposing dashboard/API
|
||||
|
||||
- [ ] Generate cryptographically strong `DASHBOARD_API_KEY` (≥32 bytes entropy)
|
||||
- [ ] Set `API_HOST=127.0.0.1`; enable tunnel only if required
|
||||
- [ ] Confirm API key is **not** prefixed with `NEXT_PUBLIC_`
|
||||
- [ ] Validate Discord OAuth permission checks on guild routes
|
||||
|
||||
### P2 — Hardening
|
||||
|
||||
- [ ] Audit SQLite file permissions on `bot/db/`
|
||||
- [ ] Review `eval()` replacements in calculator/autorole modules
|
||||
- [ ] Pin dependencies; disable runtime installs
|
||||
- [ ] Remove or relabel parody moderation commands
|
||||
|
||||
---
|
||||
|
||||
## Appendix A — Repository Structure
|
||||
|
||||
### A.1 Root
|
||||
|
||||
| Path | Description |
|
||||
|------|-------------|
|
||||
| `bot/` | Python Discord bot, FastAPI, SQLite persistence |
|
||||
| `dashboard/` | Next.js 14+ dashboard with NextAuth |
|
||||
| `PROJEKT_ANALYSE.md` | This report |
|
||||
| `SECURITY_FIXES.md` | Remediation advisory |
|
||||
|
||||
### A.2 Bot Core (`bot/`)
|
||||
|
||||
| Component | Role |
|
||||
|-----------|------|
|
||||
| `CodeX.py` | Process entry: bot, API thread, optional tunnel |
|
||||
| `core/zyrox.py` | `AutoShardedBot` subclass, prefix resolution |
|
||||
| `utils/config.py` | Centralized environment configuration |
|
||||
| `api/` | FastAPI REST layer for dashboard |
|
||||
| `cogs/` | Feature modules (~80+ extensions) |
|
||||
| `db/` | Per-module SQLite databases |
|
||||
|
||||
### A.3 Bot API Routes (`bot/api/`)
|
||||
|
||||
| Route group | Capability |
|
||||
|-------------|------------|
|
||||
| `/api/v1/guilds/*` | Guild-scoped configuration CRUD |
|
||||
| `/api/v1/admin/*` | Global stats, maintenance mode |
|
||||
| `/api/v1/bot/*` | Bot status |
|
||||
|
||||
**Authentication (post-remediation):** Bearer `DASHBOARD_API_KEY` + `X-Discord-Access-Token` with guild permission validation.
|
||||
|
||||
### A.4 Dashboard (`dashboard/`)
|
||||
|
||||
OAuth via NextAuth → guild list intersection (bot present ∧ user has Manage Guild) → proxied API calls to bot backend.
|
||||
|
||||
Key paths: `app/dashboard/guild/[guildId]/*`, `app/api/proxy/[...path]/route.ts`, `lib/api.ts`.
|
||||
|
||||
---
|
||||
|
||||
## Appendix B — Persistence Layer
|
||||
|
||||
| Database | Contents |
|
||||
|----------|----------|
|
||||
| `prefix.db` | Per-guild command prefixes |
|
||||
| `automod.db` | Automod rule configuration |
|
||||
| `block.db` | Global user/guild denylist |
|
||||
| `leveling.db` | XP and rank data |
|
||||
| `tickets.db`, `welcome.db`, `antinuke.db`, `verification.db` | Module configs |
|
||||
| `admin_config.db` | Maintenance mode flag |
|
||||
|
||||
All databases are local SQLite files under `bot/db/`. No encryption at rest observed.
|
||||
|
||||
---
|
||||
|
||||
## Appendix C — Environment Variables
|
||||
|
||||
### Bot (`.env`)
|
||||
|
||||
| Variable | Required | Security note |
|
||||
|----------|----------|---------------|
|
||||
| `TOKEN` | Yes | Discord bot secret — never commit |
|
||||
| `OWNER_IDS` | Yes | Must be operator-controlled |
|
||||
| `DASHBOARD_API_KEY` | If API enabled | Shared secret; rotate on compromise |
|
||||
| `CMD_WEBHOOK_URL` | No | Disable unless operator-owned |
|
||||
| `API_ENABLED` / `API_HOST` / `TUNNEL_ENABLED` | No | Secure defaults: off / 127.0.0.1 / off |
|
||||
| `JISHAKU_ENABLED` | No | Default: false |
|
||||
|
||||
### Dashboard (`.env`)
|
||||
|
||||
| Variable | Required | Security note |
|
||||
|----------|----------|---------------|
|
||||
| `DISCORD_CLIENT_SECRET` | Yes | Server-side only |
|
||||
| `DASHBOARD_API_KEY` | Yes | Server-side only — **not** `NEXT_PUBLIC_*` |
|
||||
| `NEXTAUTH_SECRET` | Yes | Session integrity |
|
||||
|
||||
---
|
||||
|
||||
## Appendix D — Startup Sequence
|
||||
|
||||
```
|
||||
python bot/CodeX.py
|
||||
├─ load_dotenv()
|
||||
├─ FastAPI thread (if API_ENABLED)
|
||||
├─ Cloudflare tunnel (if TUNNEL_ENABLED)
|
||||
├─ discord.py client.start(TOKEN)
|
||||
│ ├─ load cogs (~80+)
|
||||
│ ├─ load jishaku (if JISHAKU_ENABLED)
|
||||
│ └─ sync slash commands
|
||||
└─ on_ready → background tasks
|
||||
|
||||
npm run dev (dashboard/)
|
||||
├─ Next.js :3000
|
||||
└─ /api/proxy/* → Bot FastAPI (server-side key)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. Conclusion
|
||||
|
||||
ZyroX CV2 AIO is a feature-rich Discord bot platform, not a self-propagating malware sample. The primary security concern is **deployment-time trust delegation**: unchanged defaults effectively assign operational control and observability to the original publisher.
|
||||
|
||||
Operators treating this as production software must treat initial configuration as a **security-critical step**, equivalent to key ceremony for any SaaS deployment.
|
||||
|
||||
Remediation details and verification results are documented in **`SECURITY_FIXES.md`** (Advisory ZYROX-SEC-2026-REM).
|
||||
|
||||
---
|
||||
|
||||
**End of Report**
|
||||
|
||||
*For remediation status and patch verification, see `SECURITY_FIXES.md`.*
|
||||
80
PR_DESCRIPTION.md
Normal file
80
PR_DESCRIPTION.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# Security: Remove backdoors, enforce secure defaults, and harden API
|
||||
|
||||
## Summary
|
||||
|
||||
Security audit and hardening of the ZyroX CV2 AIO Discord bot with dashboard. The analysis found **no classic malware**, but several **backdoor-like mechanisms** in the original CodeX configuration (foreign owner IDs, external logging, exposed API, API key leak in the frontend).
|
||||
|
||||
This PR addresses **10 security issues** and introduces **secure defaults**: without a proper `.env` configuration, no foreign user retains owner rights, no external logging occurs, and the API is not publicly exposed.
|
||||
|
||||
### Fixed Risks
|
||||
|
||||
| # | Issue | Fix |
|
||||
|---|-------|-----|
|
||||
| 1 | Hardcoded foreign `OWNER_IDS` | No fallback — without `.env`, no one has owner rights |
|
||||
| 2 | Jishaku (Python REPL) always enabled | Opt-in only via `JISHAKU_ENABLED=true` |
|
||||
| 3 | Command logging to external webhooks | Only with a valid, complete `CMD_WEBHOOK_URL` |
|
||||
| 4 | Hardcoded Discord channel IDs | Configurable via `LOG_CHANNEL_ID`, etc. |
|
||||
| 5 | API bound to `0.0.0.0`, tunnel enabled by default | `API_ENABLED=false`, `API_HOST=127.0.0.1`, `TUNNEL_ENABLED=false` |
|
||||
| 6 | API key exposed in browser (`NEXT_PUBLIC_*`) | Server-side proxy in Next.js, key stays server-only |
|
||||
| 7 | `eval()` in calculator/autorole | New `safe_parse.py` with AST-based eval and JSON |
|
||||
| 8 | Auto `pip install` / binary download | Manual installation, download opt-in only |
|
||||
| 9 | Fake commands `hack`/`token`/`wizz` | Removed |
|
||||
| 10 | Bot API without Discord permission checks | `discord_auth.py` + token/admin validation |
|
||||
|
||||
### Additional Hardening (Follow-up Audit)
|
||||
|
||||
- API proxy requires login + guild/admin permission checks
|
||||
- Guild list filtered to manageable servers only
|
||||
- Fixed crash when `command is None` in `on_command_completion`
|
||||
- Server-only `ADMIN_IDS` support added
|
||||
|
||||
---
|
||||
|
||||
## Breaking Changes / Migration
|
||||
|
||||
**Bot (`bot/.env`):**
|
||||
|
||||
```env
|
||||
TOKEN=...
|
||||
OWNER_IDS=YOUR_DISCORD_USER_ID
|
||||
DASHBOARD_API_KEY=strong_secret
|
||||
```
|
||||
|
||||
**Dashboard (`dashboard/.env`):**
|
||||
|
||||
```env
|
||||
DASHBOARD_API_URL=http://127.0.0.1:8000/api/v1
|
||||
DASHBOARD_API_KEY=same_value_as_bot
|
||||
```
|
||||
|
||||
Remove `NEXT_PUBLIC_DASHBOARD_API_KEY` if still set.
|
||||
|
||||
Optional for dashboard/API:
|
||||
|
||||
```env
|
||||
API_ENABLED=true
|
||||
LOG_CHANNEL_ID=...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Test Plan
|
||||
|
||||
- [ ] Bot starts without `OWNER_IDS` and shows a warning; owner commands do not work
|
||||
- [ ] With `OWNER_IDS` set, owner commands work as expected
|
||||
- [ ] Jishaku loads only when `JISHAKU_ENABLED=true`
|
||||
- [ ] No webhook logging without a valid `CMD_WEBHOOK_URL`
|
||||
- [ ] No join/leave logging without `LOG_CHANNEL_ID`
|
||||
- [ ] API disabled by default; when enabled, binds to `127.0.0.1` only
|
||||
- [ ] Dashboard API calls go through `/api/proxy` — key not visible in browser
|
||||
- [ ] Unauthenticated proxy access is rejected
|
||||
- [ ] Guild API requires Discord token + Manage Server/Admin on target guild
|
||||
- [ ] Calculator: safe expressions work, injection attempts rejected
|
||||
- [ ] `hack`/`token`/`wizz` commands no longer exist
|
||||
- [ ] README and `.env.example` (bot + dashboard) updated
|
||||
|
||||
---
|
||||
|
||||
## Context
|
||||
|
||||
Based on the full security analysis in `PROJEKT_ANALYSE.md` and the applied fixes documented in `SECURITY_FIXES.md`.
|
||||
392
README.md
392
README.md
@@ -9,14 +9,22 @@
|
||||
╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
|
||||
```
|
||||
|
||||
**A feature-rich Discord bot paired with a sleek Next.js dashboard**
|
||||
<h3>A feature-rich Discord bot paired with a sleek Next.js dashboard</h3>
|
||||
|
||||
[](https://python.org)
|
||||
[](https://nextjs.org)
|
||||
[](https://fastapi.tiangolo.com)
|
||||
[](https://discordpy.readthedocs.io)
|
||||
[](LICENSE)
|
||||
[](https://discord.gg/codexdev)
|
||||
<a href="https://nexiohost.in"><img src="https://img.shields.io/badge/⭐%20PREMIUM%20HOSTING-NexioHost-FFD700?style=for-the-badge&labelColor=1a1a2e&color=FFD700&logoColor=FFD700"/></a>
|
||||
|
||||
<p>
|
||||
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white"/></a>
|
||||
<a href="https://nextjs.org"><img src="https://img.shields.io/badge/Next.js-14+-000000?style=for-the-badge&logo=nextdotjs&logoColor=white"/></a>
|
||||
<a href="https://fastapi.tiangolo.com"><img src="https://img.shields.io/badge/FastAPI-Backend-009688?style=for-the-badge&logo=fastapi&logoColor=white"/></a>
|
||||
<a href="https://discordpy.readthedocs.io"><img src="https://img.shields.io/badge/Discord.py-v2-5865F2?style=for-the-badge&logo=discord&logoColor=white"/></a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-red?style=for-the-badge"/></a>
|
||||
<a href="https://discord.gg/codexdev"><img src="https://img.shields.io/badge/Discord-Join_Server-5865F2?style=for-the-badge&logo=discord&logoColor=white"/></a>
|
||||
<a href="https://youtube.com/@CodeXDevs"><img src="https://img.shields.io/badge/YouTube-CodeXDevs-FF0000?style=for-the-badge&logo=youtube&logoColor=white"/></a>
|
||||
<a href="https://github.com/RayExo"><img src="https://img.shields.io/badge/GitHub-RayExo-181717?style=for-the-badge&logo=github&logoColor=white"/></a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -28,18 +36,21 @@ ZyroX is a fully-featured Discord bot with a modern web dashboard for managing e
|
||||
|
||||
```
|
||||
ZyroX-CV2-With-Dashboard/
|
||||
├── 🤖 bot/ Python Discord bot + FastAPI backend
|
||||
│ ├── api/ Dashboard REST API (FastAPI)
|
||||
│ ├── cogs/ All bot features (commands, events, antinuke, automod…)
|
||||
│ ├── utils/ Shared utilities (emoji, tools, sync…)
|
||||
│ ├── assets/ Fonts, backgrounds, GIFs
|
||||
│ └── CodeX.py Entry point
|
||||
├── 🤖 bot/ Python Discord bot + FastAPI backend
|
||||
│ ├── api/ Dashboard REST API (FastAPI)
|
||||
│ ├── cogs/ All bot features (commands, events, antinuke, automod…)
|
||||
│ ├── core/ Bot client, context, cog base
|
||||
│ ├── utils/ Shared utilities (emoji, tools, sync, cloudflare tunnel…)
|
||||
│ ├── games/ Standalone game modules
|
||||
│ ├── assets/ Fonts, backgrounds, GIFs
|
||||
│ └── CodeX.py Entry point
|
||||
│
|
||||
└── 🌐 dashboard/ Next.js frontend
|
||||
├── app/ App Router pages
|
||||
├── components/ Reusable UI components
|
||||
├── hooks/ Custom React hooks
|
||||
└── lib/ API helpers & utilities
|
||||
└── 🌐 dashboard/ Next.js frontend
|
||||
├── app/ App Router pages & API routes
|
||||
├── components/ Reusable UI components
|
||||
├── hooks/ Custom React hooks
|
||||
├── lib/ API helpers & utilities
|
||||
└── types/ TypeScript type definitions
|
||||
```
|
||||
|
||||
---
|
||||
@@ -51,11 +62,11 @@ ZyroX-CV2-With-Dashboard/
|
||||
<td width="50%">
|
||||
|
||||
**🛡️ Security**
|
||||
- Antinuke (ban, kick, channel/role flood, webhook abuse…)
|
||||
- Automod (spam, caps, links, invites, mass mentions, emoji spam)
|
||||
- Antinuke — ban, kick, channel & role flood, webhook abuse, bot adds, prune
|
||||
- Automod — spam, caps, links, invites, mass mentions, emoji spam
|
||||
- Anti-member update protection
|
||||
- Whitelist / unwhitelist system
|
||||
- Emergency mode
|
||||
- Emergency lockdown mode
|
||||
|
||||
</td>
|
||||
<td width="50%">
|
||||
@@ -73,9 +84,9 @@ ZyroX-CV2-With-Dashboard/
|
||||
<td>
|
||||
|
||||
**⚙️ Management**
|
||||
- Moderation (ban, kick, mute, warn, lock…)
|
||||
- Logging system
|
||||
- Reaction roles, vanity roles
|
||||
- Moderation — ban, kick, mute, warn, lock, jail, and more
|
||||
- Full logging system
|
||||
- Reaction roles, vanity roles, invite tracker
|
||||
- Tickets, giveaways, verification
|
||||
- Join-to-create voice channels
|
||||
|
||||
@@ -85,9 +96,10 @@ ZyroX-CV2-With-Dashboard/
|
||||
**🌐 Dashboard**
|
||||
- Discord OAuth2 login
|
||||
- Per-server settings management
|
||||
- Bot stats & live data
|
||||
- Live bot stats & metrics
|
||||
- Fully branded & customisable
|
||||
- Deployed to Vercel in minutes
|
||||
- HTTPS via Cloudflare Tunnel (permanent URL)
|
||||
- Deploys to Vercel in minutes
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -95,21 +107,22 @@ ZyroX-CV2-With-Dashboard/
|
||||
<td>
|
||||
|
||||
**🎉 Engagement**
|
||||
- Leveling system with XP
|
||||
- Leveling & XP system with leaderboard
|
||||
- Birthday tracker
|
||||
- Counting games, blackjack, slots
|
||||
- AFK system, autorole, autoresponder
|
||||
- Sticky messages, booster perks
|
||||
- 12+ mini-games (chess, battleship, wordle, 2048…)
|
||||
- AFK system, autorole, autoresponder, sticky messages
|
||||
- Counting, blackjack, slots, booster perks
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
**🔧 Developer**
|
||||
- Application emoji auto-sync
|
||||
- Application emoji auto-sync on startup
|
||||
- Jishaku eval support
|
||||
- Slash + prefix commands
|
||||
- FastAPI backend with API key auth
|
||||
- Hot-patchable emoji.py on startup
|
||||
- FastAPI backend with API key auth + rate limiting
|
||||
- Cloudflare Tunnel — unlimited bandwidth, permanent URL, zero system installs
|
||||
- CodeX Devs watermark on every source file
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -117,30 +130,29 @@ ZyroX-CV2-With-Dashboard/
|
||||
|
||||
---
|
||||
|
||||
## ✦ Quick Start
|
||||
## ✦ Prerequisites
|
||||
|
||||
### Prerequisites
|
||||
|
||||
| Requirement | Version |
|
||||
| Requirement | Version / Notes |
|
||||
|---|---|
|
||||
| Python | 3.10 or higher |
|
||||
| Node.js | 18 or higher |
|
||||
| A Lavalink node | v4 |
|
||||
| Lavalink node | v4 |
|
||||
| Discord bot token | — |
|
||||
| Discord OAuth app | (for dashboard) |
|
||||
| Discord OAuth app | for dashboard login |
|
||||
| Cloudflare account (free) | for HTTPS tunnel |
|
||||
|
||||
---
|
||||
|
||||
## ✦ Bot Setup
|
||||
|
||||
**1 — Clone and enter the bot folder**
|
||||
**1 — Clone the repo**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/your-org/ZyroX-CV2-With-Dashboard
|
||||
git clone https://github.com/RayExo/ZyroX-CV2-With-Dashboard
|
||||
cd ZyroX-CV2-With-Dashboard/bot
|
||||
```
|
||||
|
||||
**2 — Create a virtual environment and install dependencies**
|
||||
**2 — Install dependencies**
|
||||
|
||||
```bash
|
||||
python -m venv .venv
|
||||
@@ -156,34 +168,40 @@ pip install -r requirements.txt
|
||||
|
||||
**3 — Configure the environment**
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Then edit `.env`:
|
||||
Copy `.env.example` to `.env` and fill in the values:
|
||||
|
||||
```env
|
||||
# ── Core ──────────────────────────────────────
|
||||
TOKEN = your_discord_bot_token
|
||||
brand_name = 'ZyroX'
|
||||
# ── Core ──────────────────────────────────────────────────────────
|
||||
TOKEN = your_discord_bot_token
|
||||
brand_name = 'ZyroX'
|
||||
|
||||
# ── Lavalink ──────────────────────────────────
|
||||
LAVALINK_HOST = "lava-v4.ajieblogs.eu.org"
|
||||
LAVALINK_PASSWORD = "your_password"
|
||||
LAVALINK_SECURE = "true" # true = https (no port needed)
|
||||
LAVALINK_PORT = "" # only needed when LAVALINK_SECURE=false
|
||||
# ── Owner IDs (REQUIRED — your Discord user ID) ───────────────────
|
||||
OWNER_IDS = YOUR_DISCORD_USER_ID_HERE
|
||||
|
||||
# ── Emoji Sync ────────────────────────────────
|
||||
EMOJI_SYNC = "true" # auto-uploads & patches emoji.py on startup
|
||||
# restarts the bot automatically after patching
|
||||
# ── Lavalink ──────────────────────────────────────────────────────
|
||||
LAVALINK_HOST = "your-lavalink-host"
|
||||
LAVALINK_PASSWORD = "your_password"
|
||||
LAVALINK_SECURE = "true"
|
||||
LAVALINK_PORT = ""
|
||||
|
||||
# ── API / Dashboard Backend ───────────────────
|
||||
API_ENABLED = "true" # false = skip starting the FastAPI server
|
||||
API_PORT = "8000"
|
||||
DASHBOARD_API_KEY = "change_this_to_a_strong_secret"
|
||||
# ── Emoji Sync ────────────────────────────────────────────────────
|
||||
EMOJI_SYNC = "false"
|
||||
|
||||
# ── Webhooks ──────────────────────────────────
|
||||
WEBHOOK_URL = "https://discord.com/api/webhooks/..."
|
||||
# ── API / Dashboard Backend ───────────────────────────────────────
|
||||
API_ENABLED = "false"
|
||||
API_HOST = "127.0.0.1"
|
||||
API_PORT = "8000"
|
||||
DASHBOARD_API_KEY = "change_this_to_a_strong_secret"
|
||||
DASHBOARD_ADMIN_IDS = YOUR_DISCORD_USER_ID_HERE
|
||||
CORS_ORIGINS = ""
|
||||
|
||||
# ── Cloudflare Tunnel (optional) ──────────────────────────────────
|
||||
TUNNEL_ENABLED = "false"
|
||||
CF_TUNNEL_TOKEN = "your_tunnel_token"
|
||||
CF_TUNNEL_URL = "https://api.yourdomain.com"
|
||||
|
||||
# ── Webhooks (optional — leave unset to disable) ──────────────────
|
||||
# CMD_WEBHOOK_URL = "https://discord.com/api/webhooks/ID/TOKEN"
|
||||
```
|
||||
|
||||
**4 — Run the bot**
|
||||
@@ -205,25 +223,22 @@ npm install
|
||||
|
||||
**2 — Configure the environment**
|
||||
|
||||
```bash
|
||||
cp .env.example .env.local
|
||||
```
|
||||
|
||||
Edit `dashboard/.env.local`:
|
||||
Copy `.env.example` to `.env.local`:
|
||||
|
||||
```env
|
||||
NEXT_PUBLIC_API_URL = http://localhost:8000/api/v1
|
||||
NEXT_PUBLIC_DASHBOARD_API_KEY = your_shared_api_key # must match bot's DASHBOARD_API_KEY
|
||||
DASHBOARD_API_URL = http://127.0.0.1:8000/api/v1
|
||||
DASHBOARD_API_KEY = same_secret_as_bot_DASHBOARD_API_KEY
|
||||
|
||||
NEXTAUTH_URL = http://localhost:3000
|
||||
NEXTAUTH_SECRET = a_long_random_string
|
||||
NEXTAUTH_URL = http://localhost:3000
|
||||
NEXTAUTH_SECRET = a_long_random_string
|
||||
|
||||
DISCORD_CLIENT_ID = your_discord_oauth_client_id
|
||||
DISCORD_CLIENT_SECRET = your_discord_oauth_client_secret
|
||||
DISCORD_CLIENT_ID = your_discord_oauth_client_id
|
||||
DISCORD_CLIENT_SECRET = your_discord_oauth_client_secret
|
||||
|
||||
NEXT_PUBLIC_ADMIN_IDS = your_discord_user_id
|
||||
NEXT_PUBLIC_BRAND_NAME = "ZyroX"
|
||||
NEXT_PUBLIC_BRAND_NAME_WORD = "ZX"
|
||||
ADMIN_IDS = your_discord_user_id
|
||||
NEXT_PUBLIC_ADMIN_IDS = your_discord_user_id
|
||||
NEXT_PUBLIC_BRAND_NAME = "ZyroX"
|
||||
NEXT_PUBLIC_BRAND_NAME_WORD = "ZX"
|
||||
```
|
||||
|
||||
**3 — Run locally**
|
||||
@@ -243,120 +258,124 @@ Open [http://localhost:3000](http://localhost:3000)
|
||||
| Variable | Default | Description |
|
||||
|---|---|---|
|
||||
| `TOKEN` | — | Discord bot token |
|
||||
| `OWNER_IDS` | _(required)_ | Comma-separated owner Discord user IDs — **must be your own ID** |
|
||||
| `LAVALINK_HOST` | — | Lavalink server hostname (no protocol) |
|
||||
| `LAVALINK_PASSWORD` | — | Lavalink password |
|
||||
| `LAVALINK_SECURE` | `true` | `true` = HTTPS, `false` = HTTP |
|
||||
| `LAVALINK_PORT` | _(empty)_ | Port — only needed when `LAVALINK_SECURE=false` |
|
||||
| `EMOJI_SYNC` | `true` | Run application emoji sync on startup |
|
||||
| `API_ENABLED` | `true` | Start the FastAPI dashboard backend |
|
||||
| `EMOJI_SYNC` | `false` | Run application emoji sync on startup |
|
||||
| `JISHAKU_ENABLED` | `false` | Enable owner debug REPL (disable in production) |
|
||||
| `API_ENABLED` | `false` | Start the FastAPI dashboard backend |
|
||||
| `API_HOST` | `127.0.0.1` | Bind address — use `127.0.0.1` unless behind a reverse proxy |
|
||||
| `API_PORT` | `8000` | Port the backend listens on |
|
||||
| `DASHBOARD_API_KEY` | — | Shared secret between bot API and dashboard |
|
||||
| `WEBHOOK_URL` | — | Discord webhook for command logs |
|
||||
| `DASHBOARD_API_KEY` | — | Shared secret between bot API and dashboard (server-side only) |
|
||||
| `DASHBOARD_ADMIN_IDS` | — | Discord user IDs allowed to use admin API routes |
|
||||
| `CORS_ORIGINS` | _(empty)_ | Extra CORS-allowed origins, comma-separated |
|
||||
| `CMD_WEBHOOK_URL` | _(empty)_ | Optional Discord webhook for command logging |
|
||||
| `TUNNEL_ENABLED` | `false` | Expose the API over HTTPS via Cloudflare Tunnel |
|
||||
| `CF_TUNNEL_TOKEN` | — | Token from Cloudflare Zero Trust dashboard |
|
||||
| `CF_TUNNEL_URL` | — | Your permanent public URL (e.g. `https://api.yourdomain.com`) |
|
||||
| `LOG_CHANNEL_ID` | _(empty)_ | Optional channel for join/leave logs |
|
||||
|
||||
### Dashboard — `dashboard/.env.local`
|
||||
|
||||
| Variable | Description |
|
||||
|---|---|
|
||||
| `NEXT_PUBLIC_API_URL` | Full URL to the bot's FastAPI backend |
|
||||
| `NEXT_PUBLIC_DASHBOARD_API_KEY` | Must match `DASHBOARD_API_KEY` in the bot |
|
||||
| `DASHBOARD_API_URL` | Bot API URL (server-side, e.g. `http://127.0.0.1:8000/api/v1`) |
|
||||
| `DASHBOARD_API_KEY` | Must match `DASHBOARD_API_KEY` in the bot — **never use NEXT_PUBLIC_** |
|
||||
| `NEXTAUTH_URL` | Your dashboard's public URL |
|
||||
| `NEXTAUTH_SECRET` | Random secret for NextAuth session signing |
|
||||
| `DISCORD_CLIENT_ID` | Discord OAuth2 client ID |
|
||||
| `DISCORD_CLIENT_SECRET` | Discord OAuth2 client secret |
|
||||
| `NEXT_PUBLIC_ADMIN_IDS` | Comma-separated Discord user IDs with admin access |
|
||||
| `ADMIN_IDS` | Comma-separated Discord user IDs with admin panel access (server-side) |
|
||||
| `NEXT_PUBLIC_ADMIN_IDS` | Same IDs for client-side admin UI visibility |
|
||||
| `NEXT_PUBLIC_BRAND_NAME` | Bot name shown in the dashboard UI |
|
||||
| `NEXT_PUBLIC_BRAND_NAME_WORD` | Short abbreviation shown in the dashboard |
|
||||
|
||||
> **API security:** Guild routes require a valid Discord OAuth token with Manage Server permission. The dashboard forwards this automatically via `/api/proxy`.
|
||||
|
||||
---
|
||||
|
||||
## ✦ HTTPS Tunnel (Cloudflare)
|
||||
|
||||
The bot uses **pycloudflared** — a Python package that downloads the `cloudflared` binary automatically on first run. No CLI installs, no system packages — works on Pterodactyl and any Python host.
|
||||
|
||||
**Why Cloudflare over ngrok:**
|
||||
- ✅ Unlimited bandwidth & requests — no monthly caps
|
||||
- ✅ Permanent URL that never changes between restarts
|
||||
- ✅ Free — no paid plan needed
|
||||
- ✅ Zero system installs — binary downloads via Python
|
||||
|
||||
**Setup (browser only, no CLI needed):**
|
||||
|
||||
1. Go to [one.dash.cloudflare.com](https://one.dash.cloudflare.com) → **Networks → Tunnels → Create a tunnel**
|
||||
2. Choose **Cloudflared**, give it a name (e.g. `zyrox-api`), save
|
||||
3. On the **Install connector** step, copy the token from the command shown:
|
||||
```
|
||||
cloudflared tunnel run --token <COPY_THIS>
|
||||
```
|
||||
4. Go to **Public Hostname** tab → add a hostname:
|
||||
- Subdomain: `api` · Domain: `yourdomain.com` · Service: `http://localhost:8000`
|
||||
5. Add to `bot/.env`:
|
||||
```env
|
||||
CF_TUNNEL_TOKEN = "eyJhIjoiXXXX..."
|
||||
CF_TUNNEL_URL = "https://api.yourdomain.com"
|
||||
```
|
||||
|
||||
On every startup the console prints:
|
||||
```
|
||||
◈ Tunnel: cloudflared binary ready — starting tunnel on port 8000…
|
||||
◈ Tunnel: API is live at https://api.yourdomain.com
|
||||
↳ NEXT_PUBLIC_API_URL = https://api.yourdomain.com/api/v1
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ✦ Deployment
|
||||
|
||||
### 🤖 Bot — any Python host
|
||||
|
||||
1. Upload the entire `bot/` folder to your host (Render, Railway, Fly.io, VPS…)
|
||||
1. Upload the entire `bot/` folder to your host (Pterodactyl, Render, Railway, Fly.io, VPS…)
|
||||
2. Set the start command to `python CodeX.py`
|
||||
3. Add all environment variables from `.env.example`
|
||||
4. Make sure port `API_PORT` (`8000` by default) is publicly reachable if you're using the dashboard
|
||||
3. Add all environment variables
|
||||
4. `pycloudflared` downloads the binary automatically on first run — no extra steps
|
||||
|
||||
> Recommended free/cheap hosts: [NexioHost](https://nexiohost.in) · Render · Railway
|
||||
> Recommended free/cheap hosts: Render · Railway · Fly.io · VPS
|
||||
>
|
||||
> ⭐ **[NexioHost](https://nexiohost.in)** — Premium bot hosting, built for Discord bots. Fast, reliable, and affordable.
|
||||
|
||||
### 🌐 Dashboard — Vercel (recommended)
|
||||
### 🌐 Dashboard — Vercel
|
||||
|
||||
> **That's literally it — upload the folder, add the variables, done.**
|
||||
|
||||
**Step 1 — Upload to Vercel**
|
||||
|
||||
Go to [vercel.com](https://vercel.com) → **Add New Project** → drag and drop the `dashboard/` folder
|
||||
*(or connect your GitHub repo and set the root directory to `dashboard/`)*
|
||||
|
||||
Vercel auto-detects Next.js — no build settings to touch.
|
||||
|
||||
---
|
||||
|
||||
**Step 2 — Add environment variables**
|
||||
|
||||
In your Vercel project → **Settings → Environment Variables**, add these:
|
||||
|
||||
| Variable | Value |
|
||||
|---|---|
|
||||
| `NEXT_PUBLIC_API_URL` | Your bot API URL, e.g. `https://your-bot.render.com/api/v1` |
|
||||
| `NEXT_PUBLIC_DASHBOARD_API_KEY` | Same value as `DASHBOARD_API_KEY` in the bot `.env` |
|
||||
| `NEXTAUTH_URL` | Your Vercel domain, e.g. `https://your-app.vercel.app` |
|
||||
| `NEXTAUTH_SECRET` | Any long random string — [generate one here](https://generate-secret.vercel.app/32) |
|
||||
| `DISCORD_CLIENT_ID` | From [Discord Developer Portal](https://discord.com/developers/applications) |
|
||||
| `DISCORD_CLIENT_SECRET` | From Discord Developer Portal |
|
||||
| `NEXT_PUBLIC_ADMIN_IDS` | Your Discord user ID |
|
||||
| `NEXT_PUBLIC_BRAND_NAME` | `ZyroX` *(or your custom name)* |
|
||||
| `NEXT_PUBLIC_BRAND_NAME_WORD` | `ZX` *(short version)* |
|
||||
|
||||
---
|
||||
|
||||
**Step 3 — Add the redirect URI in Discord**
|
||||
|
||||
Go to your app in the [Discord Developer Portal](https://discord.com/developers/applications)
|
||||
→ **OAuth2 → Redirects** → add:
|
||||
|
||||
```
|
||||
https://your-app.vercel.app/api/auth/callback/discord
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Step 4 — Deploy**
|
||||
|
||||
Hit **Deploy**. Vercel builds and publishes automatically. Your dashboard is live. ✓
|
||||
1. Go to [vercel.com](https://vercel.com) → **Add New Project** → connect your GitHub repo
|
||||
2. Set root directory to `dashboard/`
|
||||
3. Add all environment variables under **Settings → Environment Variables**
|
||||
4. Add the OAuth redirect URI in Discord Developer Portal:
|
||||
```
|
||||
https://your-app.vercel.app/api/auth/callback/discord
|
||||
```
|
||||
5. Hit **Deploy** — done ✓
|
||||
|
||||
---
|
||||
|
||||
## ✦ Emoji Sync
|
||||
|
||||
ZyroX includes an automatic emoji sync system that runs on every startup (when `EMOJI_SYNC=true`):
|
||||
Runs automatically on startup when `EMOJI_SYNC=true`:
|
||||
|
||||
```
|
||||
★ Starting Application Emoji Sync — 140 unique emojis found in emoji.py
|
||||
◈ Found 140 templates | Application hosts 98 emojis
|
||||
★ Starting Application Emoji Sync — 144 unique emojis found in emoji.py
|
||||
◈ Found 144 templates | Application hosts 202 emojis
|
||||
↑ Uploading: ztick (not in application emojis)
|
||||
✔ Uploaded: ztick [saved as ID: 1234567890]
|
||||
✔ emoji.py patched in-place to reflect current API state.
|
||||
★ Restarting bot to load updated emoji IDs...
|
||||
```
|
||||
|
||||
- **New emoji** → downloaded from CDN, uploaded to your application, ID written to `emoji.py`
|
||||
- **Stale ID** → `emoji.py` is patched automatically
|
||||
- **No changes** → sync completes instantly, no restart
|
||||
- **After any patch** → bot restarts itself so the fresh IDs are live immediately
|
||||
|
||||
Set `EMOJI_SYNC=false` to disable entirely.
|
||||
|
||||
---
|
||||
|
||||
## ✦ Security Notes
|
||||
|
||||
- Never commit `.env` files or real tokens to a public repo — `.gitignore` already covers them
|
||||
- Use a strong, unique `NEXTAUTH_SECRET` and `DASHBOARD_API_KEY`
|
||||
- Rotate any secret that gets accidentally exposed
|
||||
- Keep Discord OAuth credentials in environment variables only
|
||||
- The bot API should always be behind an API key when publicly hosted
|
||||
| Event | Action |
|
||||
|---|---|
|
||||
| New emoji found | Uploaded to application, ID written to `emoji.py` |
|
||||
| Stale ID detected | `emoji.py` patched automatically |
|
||||
| No changes | Sync completes instantly, no restart |
|
||||
| After any patch | Bot restarts itself so fresh IDs are live |
|
||||
|
||||
---
|
||||
|
||||
@@ -364,52 +383,43 @@ Set `EMOJI_SYNC=false` to disable entirely.
|
||||
|
||||
| Problem | Fix |
|
||||
|---|---|
|
||||
| Bot fails to start | Check `TOKEN` is set correctly and the bot has the right gateway intents |
|
||||
| Music not working | Verify `LAVALINK_HOST`, `LAVALINK_SECURE`, and `LAVALINK_PORT` are correct |
|
||||
| Dashboard shows auth error | Check Discord OAuth client ID/secret and redirect URI in Developer Portal |
|
||||
| Dashboard can't load data | Confirm `API_ENABLED=true`, the bot is running, and `NEXT_PUBLIC_API_URL` is correct |
|
||||
| Bot fails to start | Check `TOKEN` is set and bot has correct gateway intents |
|
||||
| Music not working | Verify `LAVALINK_HOST`, `LAVALINK_SECURE`, and `LAVALINK_PORT` |
|
||||
| Dashboard auth error | Check Discord OAuth client ID/secret and redirect URI |
|
||||
| Dashboard can't load data | Confirm `API_ENABLED=true`, bot running, `DASHBOARD_API_URL` correct, user logged in via Discord |
|
||||
| API 403 on guild routes | User needs Manage Server or Admin permission on that Discord server |
|
||||
| API key rejected (401) | `DASHBOARD_API_KEY` must exactly match in bot and dashboard `.env` |
|
||||
| Emojis showing as plain text | Run with `EMOJI_SYNC=true` once to upload and patch IDs |
|
||||
| Port conflict on API | Change `API_PORT` in `.env` and update `NEXT_PUBLIC_API_URL` in the dashboard |
|
||||
| CORS errors from dashboard | Add your Vercel URL to `CORS_ORIGINS` in `bot/.env` |
|
||||
| Tunnel not starting | Check `CF_TUNNEL_TOKEN` is valid and `pycloudflared` is installed |
|
||||
| Tunnel URL changed | Set `CF_TUNNEL_URL` — named tunnels always produce the same URL |
|
||||
|
||||
---
|
||||
|
||||
## ✦ Credits & Links
|
||||
## ✦ Security
|
||||
|
||||
- Never commit `.env` files — `.gitignore` already covers them
|
||||
- Use a strong, unique `NEXTAUTH_SECRET` and `DASHBOARD_API_KEY`
|
||||
- Rotate any secret that gets accidentally exposed
|
||||
- The bot API is always behind an API key — never expose it without one
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
Developed with ❤️ by **CodeX Devs**
|
||||
## ✦ CodeX Devs
|
||||
|
||||
[](https://discord.gg/codexdev)
|
||||
[](https://nexiohost.in)
|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## ✦ License
|
||||
|
||||
```
|
||||
MIT License — Copyright (c) 2026 CodeX Devs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
```
|
||||
|
||||
<div align="center">
|
||||
|
||||
---
|
||||
|
||||
*ZyroX — Built for protection. Designed for style.*
|
||||
*Built for protection. Designed for style.*
|
||||
|
||||
<a href="https://discord.gg/codexdev"><img src="https://discord.com/api/guilds/1301573144817045524/widget.png?style=banner2" alt="CodeX Development Discord Server" width="480"/></a>
|
||||
|
||||
<p>
|
||||
<a href="https://discord.gg/codexdev"><img src="https://img.shields.io/badge/Discord-Join_Server-5865F2?style=for-the-badge&logo=discord&logoColor=white"/></a>
|
||||
<a href="https://youtube.com/@CodeXDevs"><img src="https://img.shields.io/badge/YouTube-CodeXDevs-FF0000?style=for-the-badge&logo=youtube&logoColor=white"/></a>
|
||||
<a href="https://github.com/RayExo"><img src="https://img.shields.io/badge/GitHub-RayExo-181717?style=for-the-badge&logo=github&logoColor=white"/></a>
|
||||
<a href="https://nexiohost.in"><img src="https://img.shields.io/badge/⭐%20PREMIUM%20HOSTING-NexioHost-FFD700?style=for-the-badge&labelColor=1a1a2e&color=FFD700&logoColor=FFD700"/></a>
|
||||
</p>
|
||||
|
||||
© 2026 CodeX Devs — MIT License
|
||||
|
||||
</div>
|
||||
|
||||
307
SECURITY_FIXES.md
Normal file
307
SECURITY_FIXES.md
Normal file
@@ -0,0 +1,307 @@
|
||||
# Security Remediation Advisory
|
||||
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
| **Advisory ID** | ZYROX-SEC-2026-REM |
|
||||
| **Related Report** | [PROJEKT_ANALYSE.md](PROJEKT_ANALYSE.md) (ZYROX-SEC-2026-001) |
|
||||
| **Publication Date** | 2026-07-21 |
|
||||
| **Status** | Patches applied — operator action required |
|
||||
| **Classification** | Internal — Distribution Restricted |
|
||||
| **Affected Product** | ZyroX CV2 AIO Discord Bot with Dashboard |
|
||||
|
||||
---
|
||||
|
||||
## 1. Advisory Summary
|
||||
|
||||
This document tracks remediation of findings identified during static security assessment **ZYROX-SEC-2026-001**. Ten primary findings (ZYROX-2026-001 through ZYROX-2026-010) were addressed through configuration hardening, access-control improvements, and code changes. A follow-up review on the same date identified six additional issues in the remediation itself; all were resolved prior to closing this advisory.
|
||||
|
||||
**Operator action is still required** post-update: environment files must be created or migrated per Section 6.
|
||||
|
||||
---
|
||||
|
||||
## 2. Remediation Index
|
||||
|
||||
| Fix | Finding ID | Title | Severity | Status |
|
||||
|-----|------------|-------|----------|--------|
|
||||
| #1 | ZYROX-2026-001 | Hardcoded owner fallback | Critical | ✅ Applied |
|
||||
| #2 | ZYROX-2026-002 | Jishaku enabled by default | Critical | ✅ Applied |
|
||||
| #3 | ZYROX-2026-003 | Command webhook telemetry | Critical | ✅ Applied |
|
||||
| #4 | ZYROX-2026-004 | Hardcoded log channel IDs | High | ✅ Applied |
|
||||
| #5 | ZYROX-2026-005 | Over-exposed API defaults | High | ✅ Applied |
|
||||
| #6 | ZYROX-2026-006 | Client-exposed API key | High | ✅ Applied |
|
||||
| #7 | ZYROX-2026-007 | Unsafe eval() usage | Medium | ✅ Applied |
|
||||
| #8 | ZYROX-2026-008 | Runtime pip/binary fetch | Medium | ✅ Applied |
|
||||
| #9 | ZYROX-2026-009 | Deceptive commands | Medium | ✅ Applied |
|
||||
| #10 | ZYROX-2026-005 (ext.) | Missing Discord auth on API | High | ✅ Applied |
|
||||
|
||||
---
|
||||
|
||||
## 3. Patch Details
|
||||
|
||||
### Fix #1 — Remove Hardcoded Owner Fallback
|
||||
|
||||
**Finding:** ZYROX-2026-001
|
||||
**Root cause:** `_parse_ids()` supplied third-party Discord UID `870179991462236170` when `OWNER_IDS` unset.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/utils/config.py` | `_parse_ids()` returns empty list on missing env var |
|
||||
| `bot/CodeX.py` | Startup warning when `OWNER_IDS` is empty |
|
||||
| `bot/.env.example` | Placeholder `YOUR_DISCORD_USER_ID_HERE`; foreign IDs removed |
|
||||
| `dashboard/.env.example` | `ADMIN_IDS` placeholder replaces foreign ID |
|
||||
|
||||
**Post-patch behavior:** No principal receives owner privileges without explicit configuration. Bot emits warning on empty `OWNER_IDS`.
|
||||
|
||||
**Migration:**
|
||||
```env
|
||||
OWNER_IDS=<your_discord_snowflake>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Fix #2 — Jishaku Opt-In
|
||||
|
||||
**Finding:** ZYROX-2026-002
|
||||
**Root cause:** Unconditional `load_extension("jishaku")` at startup.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/utils/config.py` | `JISHAKU_ENABLED` flag (default: `false`) |
|
||||
| `bot/CodeX.py` | Conditional extension load |
|
||||
| `bot/.env.example` | Documented opt-in flag |
|
||||
|
||||
**Post-patch behavior:** Jishaku inactive unless `JISHAKU_ENABLED=true`. Recommended for local debugging only.
|
||||
|
||||
---
|
||||
|
||||
### Fix #3 — Webhook URL Validation
|
||||
|
||||
**Finding:** ZYROX-2026-003
|
||||
**Root cause:** Command logging fired on placeholder or empty webhook URLs.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/utils/config.py` | `_valid_webhook_url()` rejects empty/placeholder values |
|
||||
| `bot/CodeX.py` | `on_command_completion` early-return when URL invalid |
|
||||
|
||||
**Post-patch behavior:** No outbound command telemetry without fully qualified, operator-configured webhook URL.
|
||||
|
||||
---
|
||||
|
||||
### Fix #4 — Externalize Log Channel IDs
|
||||
|
||||
**Finding:** ZYROX-2026-004
|
||||
**Root cause:** Hardcoded snowflakes (`1396794297386532978`, etc.) in multiple modules.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/utils/config.py` | `LOG_CHANNEL_ID`, `SERVER_COUNT_CHANNEL_ID`, `USER_COUNT_CHANNEL_ID` |
|
||||
| `bot/CodeX.py` | Config-driven channel references; stats task gated on config |
|
||||
| `bot/cogs/events/on_guild.py` | Join/leave logging conditional on `LOG_CHANNEL_ID` |
|
||||
| `bot/cogs/commands/np.py` | Audit logs use `LOG_CHANNEL_ID` |
|
||||
| `bot/.env.example` | Optional IDs documented (commented) |
|
||||
|
||||
**Post-patch behavior:** Zero external telemetry channels unless explicitly configured.
|
||||
|
||||
**Migration (optional):**
|
||||
```env
|
||||
LOG_CHANNEL_ID=<channel_snowflake>
|
||||
SERVER_COUNT_CHANNEL_ID=<channel_snowflake>
|
||||
USER_COUNT_CHANNEL_ID=<channel_snowflake>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Fix #5 — Secure API Defaults
|
||||
|
||||
**Finding:** ZYROX-2026-005
|
||||
**Root cause:** API enabled on `0.0.0.0`; tunnel enabled by default.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/utils/config.py` | `API_ENABLED=false`, `API_HOST=127.0.0.1`, `TUNNEL_ENABLED=false` |
|
||||
| `bot/CodeX.py` | Bind to `API_HOST`; warn on `0.0.0.0` |
|
||||
| `bot/.env.example` | Secure defaults documented |
|
||||
|
||||
**Post-patch behavior:** API and tunnel disabled until explicitly enabled. Localhost binding by default.
|
||||
|
||||
**Migration (dashboard use case):**
|
||||
```env
|
||||
API_ENABLED=true
|
||||
API_HOST=127.0.0.1
|
||||
DASHBOARD_API_KEY=<cryptographically_random_secret>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Fix #6 — Server-Side API Proxy
|
||||
|
||||
**Finding:** ZYROX-2026-006
|
||||
**Root cause:** `NEXT_PUBLIC_DASHBOARD_API_KEY` inlined into browser bundle.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `dashboard/app/api/proxy/[...path]/route.ts` | **New** — authenticated server-side proxy |
|
||||
| `dashboard/lib/api.ts` | Client → `/api/proxy`; SSR → direct with server env |
|
||||
| `dashboard/.env.example` | `DASHBOARD_API_KEY` (server-only); public key removed |
|
||||
|
||||
**Post-patch architecture:**
|
||||
```
|
||||
Browser → GET /api/proxy/guilds/... → Next.js (session) → Bot API + Bearer token
|
||||
SSR → Bot API direct (process.env.DASHBOARD_API_KEY)
|
||||
```
|
||||
|
||||
**Migration:**
|
||||
```env
|
||||
DASHBOARD_API_URL=http://127.0.0.1:8000/api/v1
|
||||
DASHBOARD_API_KEY=<same_value_as_bot_env>
|
||||
```
|
||||
Remove `NEXT_PUBLIC_DASHBOARD_API_KEY` from any existing `.env`.
|
||||
|
||||
---
|
||||
|
||||
### Fix #7 — Replace eval() with Safe Parsers
|
||||
|
||||
**Finding:** ZYROX-2026-007
|
||||
**Root cause:** Dynamic evaluation of user input and DB-stored strings.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/utils/safe_parse.py` | **New** — `safe_math_eval()`, `parse_role_id_list()`, `dump_role_id_list()` |
|
||||
| `bot/cogs/commands/calc.py` | AST-limited arithmetic evaluator |
|
||||
| `bot/cogs/commands/autorole.py` | JSON / `ast.literal_eval` for list deserialization |
|
||||
|
||||
**Post-patch behavior:** Calculator restricted to `[0-9+\-*/(). ]`. Autorole lists persisted as JSON with legacy read support.
|
||||
|
||||
**Verification:** Unit tests confirm `safe_math_eval('2+2')` succeeds; injection payloads rejected.
|
||||
|
||||
---
|
||||
|
||||
### Fix #8 — Disable Runtime Package Installation
|
||||
|
||||
**Finding:** ZYROX-2026-008
|
||||
**Root cause:** `os.system("pip install ...")` and unsolicited `cloudflared` download.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/utils/paginators.py` | ImportError with install instructions (no auto-pip) |
|
||||
| `bot/utils/tunnel.py` | Binary download gated on `TUNNEL_ALLOW_BINARY_DOWNLOAD=true` |
|
||||
| `bot/.env.example` | `TUNNEL_ALLOW_BINARY_DOWNLOAD=false` |
|
||||
|
||||
**Post-patch behavior:** Dependencies declared in `requirements.txt`; runtime installs removed.
|
||||
|
||||
---
|
||||
|
||||
### Fix #9 — Remove Deceptive Commands
|
||||
|
||||
**Finding:** ZYROX-2026-009
|
||||
**Root cause:** Commands simulating credential theft and server destruction.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/cogs/commands/general.py` | Removed `hack`, `token`, `wizz`; dead code cleanup |
|
||||
| `bot/cogs/zyrox/general.py` | Help index updated |
|
||||
|
||||
**Post-patch behavior:** Commands no longer registered. No regression in remaining general commands.
|
||||
|
||||
---
|
||||
|
||||
### Fix #10 — Discord Permission Enforcement on Bot API
|
||||
|
||||
**Finding:** Extension of ZYROX-2026-005 (identified in follow-up review)
|
||||
**Root cause:** API accepted bearer token alone; no guild-scoped authorization.
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `bot/api/discord_auth.py` | **New** — token validation, Manage Guild / Admin checks |
|
||||
| `bot/api/server.py` | Middleware on `/api/v1/guilds`, `/api/v1/admin`, `/api/v1/bot` |
|
||||
| `bot/api/routes/guilds.py` | `GET /guilds` filtered to authorized guilds |
|
||||
| `dashboard/lib/api.ts` | Forwards `X-Discord-Access-Token` on SSR |
|
||||
| `dashboard/app/api/proxy/[...path]/route.ts` | Header passthrough + session enforcement |
|
||||
| `bot/.env.example` | `DASHBOARD_ADMIN_IDS` documented |
|
||||
| `README.md`, `bot/README.md`, `dashboard/README.md` | Secure configuration guidance |
|
||||
|
||||
**Post-patch behavior:** Guild-scoped endpoints require valid Discord OAuth token with Manage Guild or Administrator permission on target guild.
|
||||
|
||||
---
|
||||
|
||||
## 4. Follow-Up Review (2026-07-21)
|
||||
|
||||
Secondary pass on remediation code identified gaps in the initial proxy implementation. All items below were patched same-day.
|
||||
|
||||
| Issue | Severity | Resolution |
|
||||
|-------|----------|------------|
|
||||
| API proxy accessible without session | Critical | Session gate + guild/admin validation in proxy route |
|
||||
| Guild dashboard pages lacking authZ check | High | `guild/[guildId]/layout.tsx` enforces Discord permissions |
|
||||
| `GET /guilds` returned all bot guilds | High | Proxy filters to user-manageable intersection |
|
||||
| `on_command_completion` NullPointer on `command is None` | Medium | Guard clause in `CodeX.py` |
|
||||
| Orphaned `jishaku` import in `bot/core/zyrox.py` | Low | Import removed |
|
||||
| Admin check relied solely on `NEXT_PUBLIC_ADMIN_IDS` | Medium | Server-side `ADMIN_IDS` supported |
|
||||
|
||||
---
|
||||
|
||||
## 5. Verification & Test Results
|
||||
|
||||
| Test | Method | Result |
|
||||
|------|--------|--------|
|
||||
| Python syntax | `py_compile` on modified modules | Pass |
|
||||
| Safe parser unit tests | `safe_parse` test suite | Pass — arithmetic OK, injection blocked |
|
||||
| Hardcoded channel ID grep | Static scan of `bot/` | Pass — no hardcoded snowflakes in code paths |
|
||||
| Public API key exposure | Grep `NEXT_PUBLIC_DASHBOARD_API_KEY` | Pass — removed from code and examples |
|
||||
| Proxy auth bypass (manual) | Unauthenticated request to `/api/proxy/*` | Pass — 401/403 |
|
||||
|
||||
**Regression scope:** General commands, guild config API, dashboard OAuth flow. No automated E2E suite present at time of review.
|
||||
|
||||
---
|
||||
|
||||
## 6. Operator Deployment Checklist
|
||||
|
||||
Execute after pulling patched codebase:
|
||||
|
||||
| Step | Action | Required |
|
||||
|------|--------|----------|
|
||||
| 1 | Create/update `bot/.env` with `TOKEN`, `OWNER_IDS` | Yes |
|
||||
| 2 | Create/update `dashboard/.env` with server-only `DASHBOARD_API_KEY` | Yes |
|
||||
| 3 | Delete `NEXT_PUBLIC_DASHBOARD_API_KEY` from legacy configs | Yes |
|
||||
| 4 | Set `LOG_CHANNEL_ID` etc. if logging desired | Optional |
|
||||
| 5 | Enable `API_ENABLED=true` only when dashboard is deployed | Optional |
|
||||
| 6 | Set `JISHAKU_ENABLED=true` only for controlled debugging | Optional |
|
||||
|
||||
---
|
||||
|
||||
## 7. Intentionally Unchanged (Accepted Risk)
|
||||
|
||||
| Item | Rationale | Risk Level |
|
||||
|------|-----------|------------|
|
||||
| Developer credits in `mention.py`, `stats.py` | Cosmetic attribution | Informational |
|
||||
| CodeX file headers | Branding | Informational |
|
||||
| `discord.gg/codexdev` in welcome templates | Operator-configurable content | Informational |
|
||||
|
||||
These items do not constitute exploitable vulnerabilities under the assessed threat model.
|
||||
|
||||
---
|
||||
|
||||
## 8. Residual Recommendations
|
||||
|
||||
| Area | Recommendation | Priority |
|
||||
|------|----------------|----------|
|
||||
| SQLite at rest | Restrict filesystem permissions on `bot/db/` | P2 |
|
||||
| Secret rotation | Rotate `DASHBOARD_API_KEY` and `TOKEN` on suspected compromise | P1 |
|
||||
| Dependency pinning | Lock `requirements.txt` / `package-lock.json` hashes | P2 |
|
||||
| AutoBlacklist cog | Review before enabling — aggressive auto-ban behavior | P3 |
|
||||
| Lavalink | Self-host node; avoid third-party defaults (`lavalink.jirayu.net`) | P3 |
|
||||
|
||||
---
|
||||
|
||||
## 9. Document History
|
||||
|
||||
| Version | Date | Notes |
|
||||
|---------|------|-------|
|
||||
| 1.0 | 2026-07-21 | Initial remediation (Fixes #1–#9) |
|
||||
| 1.1 | 2026-07-21 | Follow-up review + Fix #10 (Discord API authZ) |
|
||||
|
||||
---
|
||||
|
||||
**End of Advisory**
|
||||
|
||||
*Cross-reference: vulnerability details and threat context in [PROJEKT_ANALYSE.md](PROJEKT_ANALYSE.md).*
|
||||
@@ -1,31 +1,43 @@
|
||||
TOKEN = TOKEN_HERE
|
||||
TOKEN=TOKEN_HERE
|
||||
brand_name='ZyroX'
|
||||
NEXT_PUBLIC_BRAND_NAME='ZyroX'
|
||||
|
||||
# LAVALINK CONFIG
|
||||
# ── Owner / Staff IDs (REQUIRED — comma-separated Discord user IDs) ───────────
|
||||
# Set your own Discord user ID(s). No foreign IDs are used as fallback.
|
||||
OWNER_IDS=YOUR_DISCORD_USER_ID_HERE
|
||||
|
||||
# ── Optional: debug REPL for owners (disabled by default) ─────────────────────
|
||||
JISHAKU_ENABLED=false
|
||||
|
||||
# ── Optional: Discord log / stats channels (leave empty to disable) ───────────
|
||||
# LOG_CHANNEL_ID=
|
||||
# SERVER_COUNT_CHANNEL_ID=
|
||||
# USER_COUNT_CHANNEL_ID=
|
||||
|
||||
# ── Lavalink ──────────────────────────────────────────────────────────────────
|
||||
LAVALINK_HOST="lavalink.jirayu.net"
|
||||
LAVALINK_PASSWORD="youshallnotpass"
|
||||
|
||||
# Set to true if the node uses HTTPS/WSS (secure), false for HTTP/WS
|
||||
LAVALINK_SECURE="false"
|
||||
|
||||
# Only needed when LAVALINK_SECURE is false (e.g. 2333)
|
||||
LAVALINK_PORT="13592"
|
||||
|
||||
# ── Emoji Sync ────────────────────────────────────────────────────────────────
|
||||
EMOJI_SYNC="false"
|
||||
|
||||
# EMOJI SYNC CONFIG
|
||||
# Set to true to enable automatic application emoji sync on startup
|
||||
EMOJI_SYNC="true"
|
||||
|
||||
# API SERVER CONFIG
|
||||
# Set to true to enable the dashboard API server
|
||||
API_ENABLED="true"
|
||||
# Port the API server listens on
|
||||
# ── API / Dashboard Backend ───────────────────────────────────────────────────
|
||||
API_ENABLED="false"
|
||||
API_HOST="127.0.0.1"
|
||||
API_PORT="8000"
|
||||
DASHBOARD_API_KEY="generate_a_long_random_secret_here"
|
||||
# Discord user IDs allowed to use /api/v1/admin (comma-separated; falls back to OWNER_IDS)
|
||||
DASHBOARD_ADMIN_IDS=YOUR_DISCORD_USER_ID_HERE
|
||||
CORS_ORIGINS=""
|
||||
|
||||
# ON CMD RUN
|
||||
WEBHOOK_URL="https://discord.com/api/webhooks/"
|
||||
# ── Webhooks (leave empty or unset to disable command logging) ────────────────
|
||||
# CMD_WEBHOOK_URL must be a full Discord webhook URL to enable logging.
|
||||
# CMD_WEBHOOK_URL=
|
||||
|
||||
DASHBOARD_API_KEY="ZYROX_SECURE_API_KEY_12345_CHANGE_THIS_ASAP_BY_CODEX_DEVS"
|
||||
|
||||
# CODEX DEVS
|
||||
# ── Cloudflare Tunnel (disabled by default) ───────────────────────────────────
|
||||
TUNNEL_ENABLED="false"
|
||||
TUNNEL_ALLOW_BINARY_DOWNLOAD="false"
|
||||
# CF_TUNNEL_TOKEN=
|
||||
# CF_TUNNEL_URL=
|
||||
|
||||
131
bot/CodeX.py
131
bot/CodeX.py
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
# os.system("")
|
||||
@@ -21,51 +35,50 @@ from utils.config import *
|
||||
from utils.emoji import SUCCESS, ERROR, TICK, CROSS, REACTION_TEST_EMOJIS
|
||||
from utils.sync_emojis import run_sync
|
||||
|
||||
import jishaku
|
||||
import cogs
|
||||
|
||||
|
||||
os.environ["JISHAKU_NO_DM_TRACEBACK"] = "False"
|
||||
os.environ["JISHAKU_HIDE"] = "True"
|
||||
os.environ["JISHAKU_NO_UNDERSCORE"] = "True"
|
||||
os.environ["JISHAKU_FORCE_PAGINATOR"] = "True"
|
||||
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
TOKEN = os.getenv("TOKEN")
|
||||
|
||||
# --- Configuration ---
|
||||
# IMPORTANT: Replace these with your actual channel IDs.
|
||||
SERVER_COUNT_CHANNEL_ID = 1419729255977189467 # Replace with your server count channel ID
|
||||
USER_COUNT_CHANNEL_ID = 1419729283861184632 # Replace with your user count channel ID
|
||||
LOG_CHANNEL_ID = 1396794297386532978 # Replace with the channel ID for join/leave logs
|
||||
if JISHAKU_ENABLED:
|
||||
os.environ["JISHAKU_NO_DM_TRACEBACK"] = "False"
|
||||
os.environ["JISHAKU_HIDE"] = "True"
|
||||
os.environ["JISHAKU_NO_UNDERSCORE"] = "True"
|
||||
os.environ["JISHAKU_FORCE_PAGINATOR"] = "True"
|
||||
|
||||
if not OWNER_IDS:
|
||||
print("\033[33m⚠ OWNER_IDS is not set in .env — no bot owners configured.\033[0m")
|
||||
print("\033[33m Set OWNER_IDS=YOUR_DISCORD_USER_ID before running in production.\033[0m")
|
||||
|
||||
client = zyrox()
|
||||
tree = client.tree
|
||||
|
||||
# --- Background Task for Stats ---
|
||||
async def update_stats():
|
||||
"""A background task to update server and user stats in channel names."""
|
||||
"""Update server/user counts in channel names when channel IDs are configured."""
|
||||
if not SERVER_COUNT_CHANNEL_ID and not USER_COUNT_CHANNEL_ID:
|
||||
return
|
||||
await client.wait_until_ready()
|
||||
while not client.is_closed():
|
||||
try:
|
||||
servers = len(client.guilds)
|
||||
users = sum(guild.member_count for guild in client.guilds if guild.member_count is not None)
|
||||
|
||||
server_channel = client.get_channel(SERVER_COUNT_CHANNEL_ID)
|
||||
user_channel = client.get_channel(USER_COUNT_CHANNEL_ID)
|
||||
|
||||
if server_channel:
|
||||
await server_channel.edit(name=f"Servers: {servers}")
|
||||
|
||||
if user_channel:
|
||||
await user_channel.edit(name=f"Users: {users}")
|
||||
|
||||
|
||||
if SERVER_COUNT_CHANNEL_ID:
|
||||
server_channel = client.get_channel(SERVER_COUNT_CHANNEL_ID)
|
||||
if server_channel:
|
||||
await server_channel.edit(name=f"Servers: {servers}")
|
||||
|
||||
if USER_COUNT_CHANNEL_ID:
|
||||
user_channel = client.get_channel(USER_COUNT_CHANNEL_ID)
|
||||
if user_channel:
|
||||
await user_channel.edit(name=f"Users: {users}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error updating stats: {e}")
|
||||
|
||||
await asyncio.sleep(600) # Update every 10 minutes
|
||||
|
||||
await asyncio.sleep(600)
|
||||
|
||||
# --- Event Handlers ---
|
||||
@client.event
|
||||
@@ -99,49 +112,50 @@ async def on_ready():
|
||||
print(f"Error syncing command tree: {e}")
|
||||
|
||||
client.loop.create_task(sync_commands())
|
||||
client.loop.create_task(update_stats())
|
||||
if SERVER_COUNT_CHANNEL_ID or USER_COUNT_CHANNEL_ID:
|
||||
client.loop.create_task(update_stats())
|
||||
|
||||
|
||||
@client.event
|
||||
async def on_guild_join(guild: discord.Guild):
|
||||
# Log when the bot joins a server
|
||||
if not LOG_CHANNEL_ID:
|
||||
return
|
||||
log_channel = client.get_channel(LOG_CHANNEL_ID)
|
||||
if log_channel:
|
||||
await log_channel.send(f"{BRAND_NAME} has been added to the server: **{guild.name}** (ID: `{guild.id}`)")
|
||||
|
||||
@client.event
|
||||
async def on_command_completion(context: commands.Context) -> None:
|
||||
if context.author.id == 870179991462236170:
|
||||
if not CMD_WEBHOOK_URL or context.command is None or context.author.id in OWNER_IDS:
|
||||
return
|
||||
|
||||
full_command_name = context.command.qualified_name
|
||||
split = full_command_name.split("\n")
|
||||
executed_command = str(split[0])
|
||||
webhook_url = CMD_WEBHOOK_URL
|
||||
async with aiohttp.ClientSession() as session:
|
||||
webhook = discord.Webhook.from_url(webhook_url, session=session)
|
||||
|
||||
embed_color = 0xFF0000
|
||||
embed = discord.Embed(color=embed_color)
|
||||
avatar_url = context.author.display_avatar.url
|
||||
embed_color = 0xFF0000
|
||||
embed = discord.Embed(color=embed_color)
|
||||
avatar_url = context.author.display_avatar.url
|
||||
|
||||
embed.set_author(name=f"Cmd Executed: {executed_command}", icon_url=avatar_url)
|
||||
embed.set_thumbnail(url=avatar_url)
|
||||
embed.set_author(name=f"Cmd Executed: {executed_command}", icon_url=avatar_url)
|
||||
embed.set_thumbnail(url=avatar_url)
|
||||
|
||||
if context.guild is not None:
|
||||
embed.add_field(name="User", value=f"{context.author.mention} (`{context.author.id}`)", inline=False)
|
||||
embed.add_field(name="Server", value=f"{context.guild.name} (`{context.guild.id}`)", inline=False)
|
||||
embed.add_field(name="Channel", value=f"{context.channel.mention} (`{context.channel.id}`)", inline=False)
|
||||
else:
|
||||
embed.add_field(name="User (DM)", value=f"{context.author.mention} (`{context.author.id}`)", inline=False)
|
||||
|
||||
embed.timestamp = discord.utils.utcnow()
|
||||
embed.set_footer(text=f"{BRAND_NAME} Development™ ❤️", icon_url=client.user.display_avatar.url)
|
||||
|
||||
try:
|
||||
if context.guild is not None:
|
||||
embed.add_field(name="User", value=f"{context.author.mention} (`{context.author.id}`)", inline=False)
|
||||
embed.add_field(name="Server", value=f"{context.guild.name} (`{context.guild.id}`)", inline=False)
|
||||
embed.add_field(name="Channel", value=f"{context.channel.mention} (`{context.channel.id}`)", inline=False)
|
||||
else:
|
||||
embed.add_field(name="User (DM)", value=f"{context.author.mention} (`{context.author.id}`)", inline=False)
|
||||
|
||||
embed.timestamp = discord.utils.utcnow()
|
||||
embed.set_footer(text=f"{BRAND_NAME} Development™ ❤️", icon_url=client.user.display_avatar.url)
|
||||
|
||||
try:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
webhook = discord.Webhook.from_url(CMD_WEBHOOK_URL, session=session)
|
||||
await webhook.send(embed=embed)
|
||||
except Exception as e:
|
||||
print(f'Command log webhook failed: {e}')
|
||||
except Exception as e:
|
||||
print(f'Command log webhook failed: {e}')
|
||||
|
||||
|
||||
# --- Utility Commands ---
|
||||
@@ -304,27 +318,34 @@ fastapi_app = create_app()
|
||||
fastapi_app.state.bot = client
|
||||
set_bot(client)
|
||||
|
||||
API_ENABLED = os.getenv("API_ENABLED", "true").strip().lower() == "true"
|
||||
API_PORT = int(os.getenv("API_PORT", "8000"))
|
||||
|
||||
def run_api():
|
||||
uvicorn.run(fastapi_app, host='0.0.0.0', port=API_PORT, log_level="warning")
|
||||
uvicorn.run(fastapi_app, host=API_HOST, port=API_PORT, log_level="warning")
|
||||
|
||||
def keep_alive():
|
||||
if not API_ENABLED:
|
||||
print(f"\033[33m◈ API Server: Disabled via API_ENABLED=false\033[0m")
|
||||
return
|
||||
print(f"\033[32m◈ API Server: Starting on port {API_PORT}\033[0m")
|
||||
print(f"\033[32m◈ API Server: Starting on {API_HOST}:{API_PORT}\033[0m")
|
||||
if API_HOST in ("0.0.0.0", "::"):
|
||||
print("\033[33m ⚠ API bound to all interfaces — use API_HOST=127.0.0.1 unless behind a reverse proxy.\033[0m")
|
||||
server = Thread(target=run_api, daemon=True)
|
||||
server.start()
|
||||
|
||||
keep_alive()
|
||||
|
||||
# --- Cloudflare Tunnel (HTTPS for API) — only when explicitly enabled ---
|
||||
from utils.tunnel import start_tunnel
|
||||
start_tunnel()
|
||||
|
||||
# --- Main Bot Execution ---
|
||||
async def main():
|
||||
async with client:
|
||||
os.system("clear")
|
||||
await client.load_extension("jishaku")
|
||||
if JISHAKU_ENABLED:
|
||||
await client.load_extension("jishaku")
|
||||
print("\033[33m◈ Jishaku: enabled (owner-only debug REPL)\033[0m")
|
||||
else:
|
||||
print("\033[32m◈ Jishaku: disabled (set JISHAKU_ENABLED=true to enable)\033[0m")
|
||||
|
||||
max_retries = 5
|
||||
for attempt in range(max_retries):
|
||||
|
||||
21
bot/LICENSE
Normal file
21
bot/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 CodeX Devs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
349
bot/README.md
Normal file
349
bot/README.md
Normal file
@@ -0,0 +1,349 @@
|
||||
<div align="center">
|
||||
|
||||
```
|
||||
███████╗██╗ ██╗██████╗ ██████╗ ██╗ ██╗
|
||||
╚══███╔╝╚██╗ ██╔╝██╔══██╗██╔═══██╗╚██╗██╔╝
|
||||
███╔╝ ╚████╔╝ ██████╔╝██║ ██║ ╚███╔╝
|
||||
███╔╝ ╚██╔╝ ██╔══██╗██║ ██║ ██╔██╗
|
||||
███████╗ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗
|
||||
╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
|
||||
```
|
||||
|
||||
<h3>ZyroX Bot — Python Discord Bot + FastAPI Backend</h3>
|
||||
|
||||
<a href="https://nexiohost.in"><img src="https://img.shields.io/badge/⭐%20PREMIUM%20HOSTING-NexioHost-FFD700?style=for-the-badge&labelColor=1a1a2e&color=FFD700&logoColor=FFD700"/></a>
|
||||
|
||||
<p>
|
||||
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white"/></a>
|
||||
<a href="https://fastapi.tiangolo.com"><img src="https://img.shields.io/badge/FastAPI-Backend-009688?style=for-the-badge&logo=fastapi&logoColor=white"/></a>
|
||||
<a href="https://discordpy.readthedocs.io"><img src="https://img.shields.io/badge/Discord.py-v2-5865F2?style=for-the-badge&logo=discord&logoColor=white"/></a>
|
||||
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-red?style=for-the-badge"/></a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://discord.gg/codexdev"><img src="https://img.shields.io/badge/Discord-Join_Server-5865F2?style=for-the-badge&logo=discord&logoColor=white"/></a>
|
||||
<a href="https://youtube.com/@CodeXDevs"><img src="https://img.shields.io/badge/YouTube-CodeXDevs-FF0000?style=for-the-badge&logo=youtube&logoColor=white"/></a>
|
||||
<a href="https://github.com/RayExo"><img src="https://img.shields.io/badge/GitHub-RayExo-181717?style=for-the-badge&logo=github&logoColor=white"/></a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## ✦ Overview
|
||||
|
||||
This folder contains the ZyroX Discord bot built on `discord.py v2` alongside a `FastAPI` backend that powers the web dashboard. Everything runs from a single `python CodeX.py` command.
|
||||
|
||||
```
|
||||
bot/
|
||||
├── api/ FastAPI backend (routes, schemas, db manager)
|
||||
│ └── routes/ /bot /guilds /admin
|
||||
├── cogs/
|
||||
│ ├── antinuke/ Antinuke protection event listeners
|
||||
│ ├── automod/ Automod enforcement event listeners
|
||||
│ ├── commands/ All slash & prefix command modules
|
||||
│ ├── events/ General Discord event listeners
|
||||
│ ├── moderation/ Moderation action modules
|
||||
│ └── zyrox/ Core ZyroX feature cogs
|
||||
├── core/ Bot client, context, cog base classes
|
||||
├── games/ Standalone game logic + button views
|
||||
├── utils/ Emoji, tools, sync, Cloudflare tunnel
|
||||
├── assets/ Fonts, backgrounds, GIFs
|
||||
└── CodeX.py Entry point
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ✦ Features
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
|
||||
**🛡️ Antinuke**
|
||||
- Mass ban, kick, channel & role flood detection
|
||||
- Webhook abuse, bot add, prune protection
|
||||
- Anti-member update
|
||||
- Whitelist / unwhitelist system
|
||||
- Emergency lockdown mode
|
||||
|
||||
</td>
|
||||
<td width="50%">
|
||||
|
||||
**🤖 Automod**
|
||||
- Anti-spam, anti-caps, anti-links
|
||||
- Anti-invites, mass mention, emoji spam
|
||||
- Fully configurable per server
|
||||
- Works alongside Discord's native automod
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
**🎵 Music**
|
||||
- Lavalink v4 powered playback
|
||||
- YouTube, SoundCloud, JioSaavn support
|
||||
- Queue, loop, shuffle, autoplay
|
||||
- Seek, rewind, forward controls
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
**⚙️ Moderation**
|
||||
- Ban, kick, mute, warn, lock, jail
|
||||
- Snipe, message management
|
||||
- Full logging system
|
||||
- Reaction roles, vanity roles, invite tracker
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
**🎉 Engagement**
|
||||
- Leveling & XP with leaderboard
|
||||
- Birthday tracker
|
||||
- Counting, AFK, autorole, autoresponder
|
||||
- Sticky messages, booster perks, giveaways
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
**🎮 Games**
|
||||
- Chess, Battleship, Connect Four
|
||||
- Wordle, Typeracer, 2048, Memory
|
||||
- Reaction test, RPS, Tic-tac-toe
|
||||
- Country guess, Number slider, Lights out
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
**🌐 API Backend**
|
||||
- FastAPI with API key auth
|
||||
- SlowAPI rate limiting
|
||||
- Structured JSON request logging
|
||||
- CORS configured for your dashboard domain
|
||||
- `CORS_ORIGINS` env var for extra domains
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
**🔧 Developer**
|
||||
- Jishaku eval support
|
||||
- Application emoji auto-sync
|
||||
- Slash + prefix commands
|
||||
- Cloudflare Tunnel via pycloudflared — zero system installs, unlimited traffic
|
||||
- Single `OWNER_IDS` env var controls all permission checks
|
||||
- CodeX Devs watermark on every source file
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## ✦ Prerequisites
|
||||
|
||||
| Requirement | Notes |
|
||||
|---|---|
|
||||
| Python 3.10+ | — |
|
||||
| Lavalink v4 node | for music features |
|
||||
| Discord bot token | from Developer Portal |
|
||||
| Cloudflare account (free) | for HTTPS tunnel — browser setup only |
|
||||
|
||||
---
|
||||
|
||||
## ✦ Setup
|
||||
|
||||
### 1 — Install dependencies
|
||||
|
||||
```bash
|
||||
python -m venv .venv
|
||||
|
||||
# Windows
|
||||
.venv\Scripts\activate
|
||||
|
||||
# Linux / macOS
|
||||
source .venv/bin/activate
|
||||
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### 2 — Configure environment
|
||||
|
||||
Create a `.env` file (copy from `.env.example`):
|
||||
|
||||
```env
|
||||
# ── Core ──────────────────────────────────────────────────────────
|
||||
TOKEN = your_discord_bot_token
|
||||
brand_name = 'ZyroX'
|
||||
|
||||
# ── Owner IDs (REQUIRED — your Discord user ID) ───────────────────
|
||||
OWNER_IDS = YOUR_DISCORD_USER_ID_HERE
|
||||
|
||||
# ── Lavalink ──────────────────────────────────────────────────────
|
||||
LAVALINK_HOST = "your-lavalink-host"
|
||||
LAVALINK_PASSWORD = "your_password"
|
||||
LAVALINK_SECURE = "true"
|
||||
LAVALINK_PORT = ""
|
||||
|
||||
# ── Emoji Sync ────────────────────────────────────────────────────
|
||||
EMOJI_SYNC = "false"
|
||||
|
||||
# ── API / Dashboard Backend ───────────────────────────────────────
|
||||
API_ENABLED = "false"
|
||||
API_HOST = "127.0.0.1"
|
||||
API_PORT = "8000"
|
||||
DASHBOARD_API_KEY = "change_this_to_a_strong_secret"
|
||||
DASHBOARD_ADMIN_IDS = YOUR_DISCORD_USER_ID_HERE
|
||||
CORS_ORIGINS = ""
|
||||
|
||||
# ── Cloudflare Tunnel (optional) ──────────────────────────────────
|
||||
TUNNEL_ENABLED = "false"
|
||||
CF_TUNNEL_TOKEN = "your_tunnel_token"
|
||||
CF_TUNNEL_URL = "https://api.yourdomain.com"
|
||||
|
||||
# ── Webhooks (optional) ─────────────────────────────────────────────
|
||||
# CMD_WEBHOOK_URL = "https://discord.com/api/webhooks/ID/TOKEN"
|
||||
```
|
||||
|
||||
### 3 — Run
|
||||
|
||||
```bash
|
||||
python CodeX.py
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ✦ Environment Reference
|
||||
|
||||
| Variable | Default | Description |
|
||||
|---|---|---|
|
||||
| `TOKEN` | — | Discord bot token |
|
||||
| `OWNER_IDS` | _(required)_ | Comma-separated owner Discord user IDs — **your own ID only** |
|
||||
| `LAVALINK_HOST` | — | Lavalink server hostname (no protocol) |
|
||||
| `LAVALINK_PASSWORD` | — | Lavalink password |
|
||||
| `LAVALINK_SECURE` | `true` | `true` = HTTPS, `false` = HTTP |
|
||||
| `LAVALINK_PORT` | _(empty)_ | Port — only when `LAVALINK_SECURE=false` |
|
||||
| `EMOJI_SYNC` | `false` | Auto-sync application emojis on startup |
|
||||
| `JISHAKU_ENABLED` | `false` | Enable owner debug REPL (disable in production) |
|
||||
| `API_ENABLED` | `false` | Start the FastAPI dashboard backend |
|
||||
| `API_HOST` | `127.0.0.1` | Bind address for the API server |
|
||||
| `API_PORT` | `8000` | Port the backend listens on |
|
||||
| `DASHBOARD_API_KEY` | — | Shared secret with dashboard (server-side only) |
|
||||
| `DASHBOARD_ADMIN_IDS` | — | Discord user IDs for admin API routes |
|
||||
| `CORS_ORIGINS` | _(empty)_ | Extra CORS-allowed origins, comma-separated |
|
||||
| `CMD_WEBHOOK_URL` | _(empty)_ | Optional webhook for command logging |
|
||||
| `TUNNEL_ENABLED` | `false` | Expose API over HTTPS via Cloudflare Tunnel |
|
||||
| `CF_TUNNEL_TOKEN` | — | Token from Cloudflare Zero Trust dashboard |
|
||||
| `CF_TUNNEL_URL` | — | Your permanent public URL |
|
||||
| `LOG_CHANNEL_ID` | _(empty)_ | Optional channel for join/leave logs |
|
||||
|
||||
> **API security:** All `/api/v1/guilds/*` routes verify Discord Manage Server permission via `X-Discord-Access-Token` header.
|
||||
|
||||
---
|
||||
|
||||
## ✦ HTTPS Tunnel (Cloudflare)
|
||||
|
||||
Uses **pycloudflared** — downloads the `cloudflared` binary automatically on first run. No system installs, no CLI, works on Pterodactyl and any Python host.
|
||||
|
||||
**Why Cloudflare over ngrok:**
|
||||
|
||||
| | Cloudflare Tunnel | ngrok free |
|
||||
|---|---|---|
|
||||
| Bandwidth | Unlimited | 1 GB/month |
|
||||
| Requests | Unlimited | 10k/month |
|
||||
| URL stability | Permanent | Permanent (1 domain) |
|
||||
| System install | ❌ Not needed | ❌ Not needed |
|
||||
| Cost | Free | Free |
|
||||
|
||||
**Setup (browser only — no CLI needed):**
|
||||
|
||||
1. Go to [one.dash.cloudflare.com](https://one.dash.cloudflare.com) → **Networks → Tunnels → Create a tunnel**
|
||||
2. Choose **Cloudflared**, name it (e.g. `zyrox-api`), save
|
||||
3. On **Install connector**, copy the token from the command shown:
|
||||
```
|
||||
cloudflared tunnel run --token <COPY_THIS_TOKEN>
|
||||
```
|
||||
4. On **Public Hostname** tab → add a hostname:
|
||||
- Subdomain: `api` · Domain: `yourdomain.com` · Service: `http://localhost:8000`
|
||||
5. Add to `.env`:
|
||||
```env
|
||||
CF_TUNNEL_TOKEN = "eyJhIjoiXXXX..."
|
||||
CF_TUNNEL_URL = "https://api.yourdomain.com"
|
||||
```
|
||||
|
||||
On every startup the console prints:
|
||||
```
|
||||
◈ Tunnel: cloudflared binary ready — starting tunnel on port 8000…
|
||||
◈ Tunnel: API is live at https://api.yourdomain.com
|
||||
↳ DASHBOARD_API_URL = https://api.yourdomain.com/api/v1
|
||||
```
|
||||
|
||||
Set `TUNNEL_ENABLED=false` to disable.
|
||||
|
||||
---
|
||||
|
||||
## ✦ Emoji Sync
|
||||
|
||||
When `EMOJI_SYNC=true`, the bot syncs application emojis on every startup:
|
||||
|
||||
| Event | Action |
|
||||
|---|---|
|
||||
| New emoji found | Uploaded to application, ID written to `emoji.py` |
|
||||
| Stale ID detected | `emoji.py` patched automatically |
|
||||
| No changes | Sync completes instantly, no restart |
|
||||
| After any patch | Bot restarts so fresh IDs are live |
|
||||
|
||||
---
|
||||
|
||||
## ✦ Deployment
|
||||
|
||||
Upload the entire `bot/` folder to your host and set the start command to:
|
||||
|
||||
```bash
|
||||
python CodeX.py
|
||||
```
|
||||
|
||||
`pycloudflared` downloads the binary on first run — no extra steps on any host.
|
||||
|
||||
> Recommended free hosts: Render · Railway · Fly.io · Pterodactyl
|
||||
>
|
||||
> ⭐ **[NexioHost](https://nexiohost.in)** — Premium bot hosting, built for Discord bots. Fast, reliable, and affordable.
|
||||
|
||||
---
|
||||
|
||||
## ✦ Troubleshooting
|
||||
|
||||
| Problem | Fix |
|
||||
|---|---|
|
||||
| Bot fails to start | Check `TOKEN` and gateway intents in Developer Portal |
|
||||
| Music not working | Verify `LAVALINK_HOST`, `LAVALINK_SECURE`, `LAVALINK_PORT` |
|
||||
| Dashboard can't reach API | Check `API_ENABLED=true`, `DASHBOARD_API_URL` in dashboard, and Discord login |
|
||||
| CORS errors | Add your Vercel URL to `CORS_ORIGINS` in `.env` |
|
||||
| Emojis showing as plain text | Run once with `EMOJI_SYNC=true` to upload and patch IDs |
|
||||
| Tunnel not starting | Check `CF_TUNNEL_TOKEN` is valid and `pycloudflared` is installed |
|
||||
| Want to add an owner | Add their ID to `OWNER_IDS` in `.env` — no code changes needed |
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
## ✦ CodeX Devs
|
||||
|
||||
*Built for protection. Designed for style.*
|
||||
|
||||
<a href="https://discord.gg/codexdev"><img src="https://discord.com/api/guilds/1301573144817045524/widget.png?style=banner2" alt="CodeX Development Discord Server" width="480"/></a>
|
||||
|
||||
<p>
|
||||
<a href="https://discord.gg/codexdev"><img src="https://img.shields.io/badge/Discord-Join_Server-5865F2?style=for-the-badge&logo=discord&logoColor=white"/></a>
|
||||
<a href="https://youtube.com/@CodeXDevs"><img src="https://img.shields.io/badge/YouTube-CodeXDevs-FF0000?style=for-the-badge&logo=youtube&logoColor=white"/></a>
|
||||
<a href="https://github.com/RayExo"><img src="https://img.shields.io/badge/GitHub-RayExo-181717?style=for-the-badge&logo=github&logoColor=white"/></a>
|
||||
<a href="https://nexiohost.in"><img src="https://img.shields.io/badge/⭐%20PREMIUM%20HOSTING-NexioHost-FFD700?style=for-the-badge&labelColor=1a1a2e&color=FFD700&logoColor=FFD700"/></a>
|
||||
</p>
|
||||
|
||||
© 2026 CodeX Devs — MIT License
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import aiosqlite
|
||||
import asyncio
|
||||
from typing import Dict
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import os
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
from fastapi import HTTPException, Depends, Security
|
||||
|
||||
130
bot/api/discord_auth.py
Normal file
130
bot/api/discord_auth.py
Normal file
@@ -0,0 +1,130 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ Discord OAuth permission checks for dashboard API requests ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
import aiohttp
|
||||
from fastapi import HTTPException, Request
|
||||
|
||||
from utils.config import OWNER_IDS_STR
|
||||
|
||||
MANAGE_GUILD = 0x20
|
||||
ADMINISTRATOR = 0x8
|
||||
|
||||
GUILD_PATH_RE = re.compile(r"^/api/v1/guilds/(\d+)(?:/|$)")
|
||||
|
||||
|
||||
def _parse_admin_ids() -> list[str]:
|
||||
import os
|
||||
|
||||
raw = os.getenv("DASHBOARD_ADMIN_IDS", "").strip()
|
||||
if raw:
|
||||
return [p.strip() for p in raw.split(",") if p.strip().isdigit()]
|
||||
return list(OWNER_IDS_STR)
|
||||
|
||||
|
||||
def can_manage_guild(guild: dict[str, Any]) -> bool:
|
||||
if guild.get("owner"):
|
||||
return True
|
||||
try:
|
||||
perms = int(guild.get("permissions", "0"))
|
||||
except (TypeError, ValueError):
|
||||
return False
|
||||
return bool(perms & ADMINISTRATOR) or bool(perms & MANAGE_GUILD)
|
||||
|
||||
|
||||
async def fetch_user_guilds(access_token: str) -> list[dict[str, Any]]:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(
|
||||
"https://discord.com/api/users/@me/guilds",
|
||||
headers={"Authorization": f"Bearer {access_token}"},
|
||||
) as resp:
|
||||
if resp.status != 200:
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="Invalid or expired Discord access token.",
|
||||
)
|
||||
data = await resp.json()
|
||||
return data if isinstance(data, list) else []
|
||||
|
||||
|
||||
async def verify_discord_token(access_token: str) -> dict[str, Any]:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(
|
||||
"https://discord.com/api/users/@me",
|
||||
headers={"Authorization": f"Bearer {access_token}"},
|
||||
) as resp:
|
||||
if resp.status != 200:
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="Invalid or expired Discord access token.",
|
||||
)
|
||||
return await resp.json()
|
||||
|
||||
|
||||
async def user_can_manage_guild(access_token: str, guild_id: int) -> bool:
|
||||
guilds = await fetch_user_guilds(access_token)
|
||||
for guild in guilds:
|
||||
if str(guild.get("id")) == str(guild_id):
|
||||
return can_manage_guild(guild)
|
||||
return False
|
||||
|
||||
|
||||
async def get_manageable_guild_ids(access_token: str) -> set[str]:
|
||||
guilds = await fetch_user_guilds(access_token)
|
||||
return {str(g["id"]) for g in guilds if can_manage_guild(g)}
|
||||
|
||||
|
||||
def get_discord_headers(request: Request) -> tuple[str | None, str | None]:
|
||||
token = request.headers.get("X-Discord-Access-Token")
|
||||
user_id = request.headers.get("X-Discord-User-Id")
|
||||
return token, user_id
|
||||
|
||||
|
||||
async def require_discord_session(request: Request) -> tuple[str, str]:
|
||||
token, user_id = get_discord_headers(request)
|
||||
if not token:
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="X-Discord-Access-Token header is required.",
|
||||
)
|
||||
|
||||
user = await verify_discord_token(token)
|
||||
resolved_id = str(user.get("id", ""))
|
||||
if not resolved_id:
|
||||
raise HTTPException(status_code=403, detail="Could not resolve Discord user.")
|
||||
|
||||
if user_id and user_id != resolved_id:
|
||||
raise HTTPException(status_code=403, detail="Discord user ID mismatch.")
|
||||
|
||||
return token, resolved_id
|
||||
|
||||
|
||||
async def require_guild_access(request: Request, guild_id: int) -> None:
|
||||
token, _ = await require_discord_session(request)
|
||||
if not await user_can_manage_guild(token, guild_id):
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="You do not have permission to manage this guild.",
|
||||
)
|
||||
|
||||
|
||||
async def require_dashboard_admin(request: Request) -> None:
|
||||
token, user_id = await require_discord_session(request)
|
||||
admin_ids = _parse_admin_ids()
|
||||
if user_id not in admin_ids:
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="Dashboard admin access required.",
|
||||
)
|
||||
|
||||
|
||||
def extract_guild_id_from_path(path: str) -> int | None:
|
||||
match = GUILD_PATH_RE.match(path)
|
||||
if not match:
|
||||
return None
|
||||
return int(match.group(1))
|
||||
@@ -0,0 +1,14 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from api.dependencies import get_bot
|
||||
from api.schemas import AdminStats, AdminNodeStatus, AdminConfig, AdminConfigUpdate
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
from api.dependencies import get_bot
|
||||
from api.schemas import BotInfo, BotStatus
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request
|
||||
from api.dependencies import get_bot, limiter
|
||||
from api.discord_auth import require_discord_session, get_manageable_guild_ids
|
||||
from api.db_manager import db_manager
|
||||
from api.schemas import (
|
||||
GuildSummary, GuildDetails, PrefixConfig, AutomodConfig,
|
||||
@@ -27,13 +42,18 @@ if TYPE_CHECKING:
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/", response_model=List[GuildSummary], summary="List all guilds", description="Returns a summary of all guilds the bot is currently in.")
|
||||
async def list_guilds(bot: "zyrox" = Depends(get_bot)):
|
||||
@router.get("/", response_model=List[GuildSummary], summary="List all guilds", description="Returns guilds the authenticated user can manage that the bot is in.")
|
||||
async def list_guilds(request: Request, bot: "zyrox" = Depends(get_bot)):
|
||||
"""
|
||||
Lists detailed information about all guilds the bot is currently in.
|
||||
Lists guilds the bot is in, filtered to those the caller can manage on Discord.
|
||||
"""
|
||||
token, _ = await require_discord_session(request)
|
||||
manageable_ids = await get_manageable_guild_ids(token)
|
||||
|
||||
guilds_list = []
|
||||
for guild in bot.guilds:
|
||||
if str(guild.id) not in manageable_ids:
|
||||
continue
|
||||
guilds_list.append(GuildSummary(
|
||||
id=str(guild.id),
|
||||
name=guild.name,
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from pydantic import BaseModel, HttpUrl
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
from fastapi import FastAPI, Depends, Request
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from fastapi import FastAPI, Depends, Request, HTTPException
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from contextlib import asynccontextmanager
|
||||
import os
|
||||
import time
|
||||
import json
|
||||
import logging
|
||||
@@ -13,6 +28,13 @@ from utils.config import *
|
||||
from api.routes import bot, guilds, admin
|
||||
from api.dependencies import verify_api_key, limiter
|
||||
from api.db_manager import db_manager
|
||||
from api.discord_auth import (
|
||||
require_dashboard_admin,
|
||||
require_discord_session,
|
||||
require_guild_access,
|
||||
extract_guild_id_from_path,
|
||||
)
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
# Configure logging
|
||||
logger = logging.getLogger("api_request_logs")
|
||||
@@ -42,6 +64,29 @@ def create_app() -> FastAPI:
|
||||
lifespan=lifespan
|
||||
)
|
||||
|
||||
# Discord permission checks for dashboard API routes
|
||||
@app.middleware("http")
|
||||
async def discord_permission_middleware(request: Request, call_next):
|
||||
if request.method == "OPTIONS":
|
||||
return await call_next(request)
|
||||
|
||||
path = request.url.path
|
||||
try:
|
||||
if path.startswith("/api/v1/admin"):
|
||||
await require_dashboard_admin(request)
|
||||
elif path.startswith("/api/v1/bot"):
|
||||
await require_discord_session(request)
|
||||
elif path.startswith("/api/v1/guilds"):
|
||||
guild_id = extract_guild_id_from_path(path)
|
||||
if guild_id is not None:
|
||||
await require_guild_access(request, guild_id)
|
||||
else:
|
||||
await require_discord_session(request)
|
||||
except HTTPException as exc:
|
||||
return JSONResponse(status_code=exc.status_code, content={"detail": exc.detail})
|
||||
|
||||
return await call_next(request)
|
||||
|
||||
# Structured Logging Middleware
|
||||
@app.middleware("http")
|
||||
async def log_requests(request: Request, call_next):
|
||||
@@ -66,14 +111,23 @@ def create_app() -> FastAPI:
|
||||
app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler)
|
||||
app.add_middleware(SlowAPIMiddleware)
|
||||
|
||||
# Build allowed origins from env + hardcoded fallbacks
|
||||
_extra_origins = [
|
||||
o.strip()
|
||||
for o in os.getenv("CORS_ORIGINS", "").split(",")
|
||||
if o.strip()
|
||||
]
|
||||
_allowed_origins = list(dict.fromkeys([
|
||||
"http://localhost:3000",
|
||||
"https://localhost:3000",
|
||||
"https://your-vercel-url-here.vercel.app",
|
||||
*_extra_origins,
|
||||
]))
|
||||
|
||||
# Enable CORS for Next.js dashboard
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=[
|
||||
"http://localhost:3000",
|
||||
"https://localhost:3000",
|
||||
# Add production domain here later
|
||||
],
|
||||
allow_origins=_allowed_origins,
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from __future__ import annotations
|
||||
from core import zyrox
|
||||
from colorama import Fore, Style, init
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands, tasks
|
||||
import json
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import os
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import os
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
import aiosqlite
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ui import LayoutView, TextDisplay, Separator, Container, Button, ActionRow
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import os
|
||||
import discord
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, MANAGER, REDDOT, TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import ARROWRED, CROSS, DISABLE, ENABLE, MANAGER, TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, EMOTE, TICK, ZSAFE, ZSETTINGS
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, DISABLE, ENABLE, TICK, TICK_ALT
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, ICONS_WARNING, TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from __future__ import annotations
|
||||
import discord
|
||||
from utils.emoji import CROSS, ICONS_WARNING, TICK
|
||||
@@ -8,6 +22,8 @@ from typing import List, Dict
|
||||
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
||||
from utils.Tools import *
|
||||
from utils.cv2 import CV2, build_container
|
||||
from utils.config import OWNER_IDS
|
||||
from utils.safe_parse import parse_role_id_list, dump_role_id_list
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +41,7 @@ class BasicView(discord.ui.View):
|
||||
self.ctx = ctx
|
||||
|
||||
async def interaction_check(self, interaction: discord.Interaction):
|
||||
if interaction.user.id != self.ctx.author.id and interaction.user.id not in [870179991462236170]:
|
||||
if interaction.user.id != self.ctx.author.id and interaction.user.id not in OWNER_IDS:
|
||||
await interaction.response.send_message("Uh oh! That message doesn't belong to you.\nYou must run this command to interact with it.", ephemeral=True)
|
||||
return False
|
||||
return True
|
||||
@@ -217,7 +233,7 @@ class AutoRole(commands.Cog):
|
||||
data = await cursor.fetchone()
|
||||
|
||||
if data:
|
||||
humans = eval(data[0])
|
||||
humans = parse_role_id_list(data[0])
|
||||
if role.id in humans:
|
||||
view = CV2(f"{ICONS_WARNING} Access Denied", f"{role.mention} is already in human autoroles.")
|
||||
elif len(humans) >= 10:
|
||||
@@ -225,13 +241,13 @@ class AutoRole(commands.Cog):
|
||||
else:
|
||||
humans.append(role.id)
|
||||
async with aiosqlite.connect(DATABASE_PATH) as db:
|
||||
await db.execute("UPDATE autorole SET humans = ? WHERE guild_id = ?", (str(humans), ctx.guild.id))
|
||||
await db.execute("UPDATE autorole SET humans = ? WHERE guild_id = ?", (dump_role_id_list(humans), ctx.guild.id))
|
||||
await db.commit()
|
||||
view = CV2(f"{TICK} Success", f"{role.mention} has been added to human autoroles.")
|
||||
else:
|
||||
humans = [role.id]
|
||||
async with aiosqlite.connect(DATABASE_PATH) as db:
|
||||
await db.execute("INSERT INTO autorole (guild_id, humans, bots) VALUES (?, ?, ?)", (ctx.guild.id, str(humans), '[]'))
|
||||
await db.execute("INSERT INTO autorole (guild_id, humans, bots) VALUES (?, ?, ?)", (ctx.guild.id, dump_role_id_list(humans), '[]'))
|
||||
await db.commit()
|
||||
view = CV2(f"{TICK} Success", f"{role.mention} has been added to human autoroles.")
|
||||
|
||||
@@ -250,13 +266,13 @@ class AutoRole(commands.Cog):
|
||||
data = await cursor.fetchone()
|
||||
|
||||
if data:
|
||||
humans = eval(data[0])
|
||||
humans = parse_role_id_list(data[0])
|
||||
if role.id not in humans:
|
||||
view = CV2(f"{CROSS} Error", f"{role.mention} is not in human autoroles.")
|
||||
else:
|
||||
humans.remove(role.id)
|
||||
async with aiosqlite.connect(DATABASE_PATH) as db:
|
||||
await db.execute("UPDATE autorole SET humans = ? WHERE guild_id = ?", (str(humans), ctx.guild.id))
|
||||
await db.execute("UPDATE autorole SET humans = ? WHERE guild_id = ?", (dump_role_id_list(humans), ctx.guild.id))
|
||||
await db.commit()
|
||||
view = CV2(f"{TICK} Success", f"{role.mention} has been removed from human autoroles.")
|
||||
else:
|
||||
@@ -288,7 +304,7 @@ class AutoRole(commands.Cog):
|
||||
data = await cursor.fetchone()
|
||||
|
||||
if data:
|
||||
bots = eval(data[0])
|
||||
bots = parse_role_id_list(data[0])
|
||||
if role.id in bots:
|
||||
view = CV2(f"{ICONS_WARNING} Access Denied", f"{role.mention} is already in bot autoroles.")
|
||||
elif len(bots) >= 10:
|
||||
@@ -296,13 +312,13 @@ class AutoRole(commands.Cog):
|
||||
else:
|
||||
bots.append(role.id)
|
||||
async with aiosqlite.connect(DATABASE_PATH) as db:
|
||||
await db.execute("UPDATE autorole SET bots = ? WHERE guild_id = ?", (str(bots), ctx.guild.id))
|
||||
await db.execute("UPDATE autorole SET bots = ? WHERE guild_id = ?", (dump_role_id_list(bots), ctx.guild.id))
|
||||
await db.commit()
|
||||
view = CV2(f"{TICK} Success", f"{role.mention} has been added to bot autoroles.")
|
||||
else:
|
||||
bots = [role.id]
|
||||
async with aiosqlite.connect(DATABASE_PATH) as db:
|
||||
await db.execute("INSERT INTO autorole (guild_id, humans, bots) VALUES (?, ?, ?)", (ctx.guild.id, '[]', str(bots)))
|
||||
await db.execute("INSERT INTO autorole (guild_id, humans, bots) VALUES (?, ?, ?)", (ctx.guild.id, '[]', dump_role_id_list(bots)))
|
||||
await db.commit()
|
||||
view = CV2(f"{TICK} Success", f"{role.mention} has been added to bot autoroles.")
|
||||
|
||||
@@ -321,13 +337,13 @@ class AutoRole(commands.Cog):
|
||||
data = await cursor.fetchone()
|
||||
|
||||
if data:
|
||||
bots = eval(data[0])
|
||||
bots = parse_role_id_list(data[0])
|
||||
if role.id not in bots:
|
||||
view = CV2(f"{CROSS} Error", f"{role.mention} is not in bot autoroles.")
|
||||
else:
|
||||
bots.remove(role.id)
|
||||
async with aiosqlite.connect(DATABASE_PATH) as db:
|
||||
await db.execute("UPDATE autorole SET bots = ? WHERE guild_id = ?", (str(bots), ctx.guild.id))
|
||||
await db.execute("UPDATE autorole SET bots = ? WHERE guild_id = ?", (dump_role_id_list(bots), ctx.guild.id))
|
||||
await db.commit()
|
||||
view = CV2(f"{TICK} Success", f"{role.mention} has been removed from bot autoroles.")
|
||||
else:
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import os
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from __future__ import annotations
|
||||
import discord
|
||||
from utils.emoji import CROSS, NITRO_BOOST, TICK, TIMER
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from discord.ext import commands
|
||||
from discord.ui import View, Button, button
|
||||
import discord
|
||||
from utils.safe_parse import safe_math_eval
|
||||
|
||||
|
||||
class CalculatorView(View):
|
||||
@@ -75,7 +90,7 @@ class CalculatorView(View):
|
||||
)
|
||||
try:
|
||||
expression = self.value.strip().replace("\n", "")
|
||||
result = str(eval(expression))
|
||||
result = safe_math_eval(expression)
|
||||
await self.update_embed(interaction, result)
|
||||
self.value = result # Store the result for possible further calculations
|
||||
except:
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import ARROWRED, CROSS, NEXT_ALT1, REDRULESBOOK, RED_BUTTON, RED_PIN, STAR, TICK, ZBACK, ZPAUSE, ZPLAY, ZWARNING
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK, ZWARNING
|
||||
from discord import app_commands
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ui import LayoutView, TextDisplay, Separator, Container, Button, ActionRow
|
||||
from discord.ext import commands
|
||||
from utils.cv2 import CV2, build_container
|
||||
|
||||
authorized_staff_ids = [
|
||||
1263404140965396555,
|
||||
767979794411028491
|
||||
]
|
||||
from utils.config import STAFF_IDS
|
||||
|
||||
|
||||
class SuccessView(LayoutView):
|
||||
@@ -74,7 +84,7 @@ class StaffDMCog(commands.Cog):
|
||||
|
||||
@commands.command(name="dmstaff")
|
||||
async def dm_staff(self, ctx, member: discord.Member, *, message: str):
|
||||
if ctx.author.id not in authorized_staff_ids:
|
||||
if ctx.author.id not in STAFF_IDS:
|
||||
view = PermissionErrorView()
|
||||
await ctx.reply(view=view)
|
||||
return
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, CROSS_ALT, ML_CROSS, TICK, TICK_ALT, ZWARNING
|
||||
from discord.ui import LayoutView, TextDisplay, Separator, Container, Button, ActionRow
|
||||
@@ -5,6 +19,7 @@ from discord.ext import commands
|
||||
import aiosqlite
|
||||
from utils.Tools import *
|
||||
from utils.cv2 import CV2, build_container
|
||||
from utils.config import OWNER_IDS_STR
|
||||
|
||||
|
||||
class EmergencyRestoreConfirmView(LayoutView):
|
||||
@@ -405,9 +420,7 @@ class Emergency(commands.Cog):
|
||||
@commands.cooldown(1, 4, commands.BucketType.user)
|
||||
@commands.guild_only()
|
||||
async def enable(self, ctx):
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
||||
"870179991462236170"
|
||||
]:
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||
return await ctx.reply(view=EnableErrorView())
|
||||
dangerous_perms = [
|
||||
"administrator",
|
||||
@@ -446,9 +459,7 @@ class Emergency(commands.Cog):
|
||||
@commands.cooldown(1, 4, commands.BucketType.user)
|
||||
@commands.guild_only()
|
||||
async def disable(self, ctx):
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
||||
"870179991462236170"
|
||||
]:
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||
return await ctx.reply(view=DisableErrorView())
|
||||
async with aiosqlite.connect(self.db_path) as db:
|
||||
await db.execute(
|
||||
@@ -612,7 +623,7 @@ class Emergency(commands.Cog):
|
||||
async def emergencysituation(self, ctx):
|
||||
if not await self.is_guild_owner_or_authorised(ctx) and str(
|
||||
ctx.author.id
|
||||
) not in ["870179991462236170"]:
|
||||
) not in OWNER_IDS_STR:
|
||||
return await ctx.reply(view=EmergencySituationErrorView("access"))
|
||||
|
||||
proc_msg = await ctx.reply(
|
||||
@@ -732,9 +743,7 @@ class Emergency(commands.Cog):
|
||||
@commands.guild_only()
|
||||
@commands.bot_has_permissions(manage_roles=True)
|
||||
async def emergencyrestore(self, ctx):
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
||||
"870179991462236170"
|
||||
]:
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||
return await ctx.reply(view=EmergencyRestoreAccessErrorView())
|
||||
|
||||
async with aiosqlite.connect(self.db_path) as db:
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import base64
|
||||
import binascii
|
||||
import codecs
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import os
|
||||
import discord
|
||||
from utils.emoji import BOOST, CODEBASE, CROSS, KING, TICK, UPTIME, ZWARNING
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK, ZWARNING
|
||||
from discord.ext import commands
|
||||
@@ -5,6 +19,7 @@ from discord.ui import LayoutView, TextDisplay, Separator, Container, ActionRow,
|
||||
import aiosqlite
|
||||
from utils.Tools import *
|
||||
from utils.cv2 import CV2, build_container
|
||||
from utils.config import OWNER_IDS_STR
|
||||
|
||||
|
||||
|
||||
@@ -92,7 +107,7 @@ class Extraowner(commands.Cog):
|
||||
if ctx.guild.member_count < 2:
|
||||
return await ctx.send(view=CV2(f"{CROSS} Error", "Your Server Doesn't Meet My 30 Member Criteria"))
|
||||
|
||||
Ray = ['870179991462236170','767979794411028491']
|
||||
Ray = OWNER_IDS_STR
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in Ray:
|
||||
return await ctx.send(view=CV2(f"{ZWARNING} Access Denied", "Only Server Owner Can Run This Command"))
|
||||
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import sqlite3
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from typing import Union
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ui import LayoutView, TextDisplay, Separator, MediaGallery
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import asyncio
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK, ZWARNING, ZYROXCONNECTION, ZYROXLINKS
|
||||
@@ -24,11 +38,6 @@ from typing import *
|
||||
import string
|
||||
from utils.cv2 import CV2, build_container
|
||||
|
||||
lawda = [
|
||||
'8', '3821', '23', '21', '313', '43', '29', '76', '11', '9',
|
||||
'44', '470', '318' , '26', '69'
|
||||
]
|
||||
|
||||
|
||||
class AvatarView(View):
|
||||
def __init__(self, user, member, author_id, banner_url):
|
||||
@@ -200,55 +209,6 @@ class General(commands.Cog):
|
||||
await msg.add_reaction(CROSS)
|
||||
|
||||
|
||||
@commands.command(name="hack",
|
||||
help="hack someone's discord account",
|
||||
usage="Hack <member>")
|
||||
@blacklist_check()
|
||||
@ignore_check()
|
||||
@commands.cooldown(1, 3, commands.BucketType.user)
|
||||
async def hack(self, ctx: commands.Context, member: discord.Member):
|
||||
stringi = member.name
|
||||
min_length = 2
|
||||
max_length = 12
|
||||
length = random.randint(min_length, max_length)
|
||||
stringg = member.name
|
||||
remaining_length = length - len(stringg)
|
||||
all_chars = string.ascii_letters + string.digits + string.punctuation
|
||||
random_chars = random.choices(all_chars, k=remaining_length)
|
||||
|
||||
password = stringg + ''.join(random_chars)
|
||||
|
||||
lund = await ctx.send(f"Processing to Hack {member.mention}...")
|
||||
await asyncio.sleep(2)
|
||||
random_pass = random.choice(lawda)
|
||||
|
||||
random_pass2 = ''.join(random.choices(string.ascii_letters + string.digits, k=3))
|
||||
hack_text = (
|
||||
f"**User:** {member.mention}\n"
|
||||
f"**E-Mail:** {''.join(c for c in stringi if c.isalnum())}{random_pass}@gmail.com\n"
|
||||
f"**Account Password:** {member.name}@{random_pass2}"
|
||||
)
|
||||
await ctx.send(view=CV2(f"Hacked {member.display_name}!", hack_text))
|
||||
await lund.delete()
|
||||
|
||||
|
||||
@commands.command(name="token", usage="Token <member>")
|
||||
@blacklist_check()
|
||||
@ignore_check()
|
||||
@commands.cooldown(1, 2, commands.BucketType.user)
|
||||
async def token(self, ctx: commands.Context, user: discord.Member = None):
|
||||
list = [
|
||||
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
|
||||
"O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "_"
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
||||
'ñ', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0',
|
||||
'1', '2', '3', '4', '5', '6', '7', '8', '9'
|
||||
]
|
||||
token = random.choices(list, k=59)
|
||||
if user is None:
|
||||
user = ctx.author
|
||||
await ctx.send(view=CV2("🔐 Token", f"{user.mention}'s token: `{''.join(token)}`"))
|
||||
|
||||
@commands.command(name="users", help=f"checks total users of {BotName}.")
|
||||
@blacklist_check()
|
||||
@ignore_check()
|
||||
@@ -260,34 +220,6 @@ class General(commands.Cog):
|
||||
await ctx.send(view=CV2(f"{BotName} Users", f"❯ Total of __**{users}**__ Users in **{guilds}** Guilds"))
|
||||
|
||||
|
||||
@commands.command(name="wizz", usage="Wizz")
|
||||
@blacklist_check()
|
||||
@ignore_check()
|
||||
@commands.cooldown(1, 3, commands.BucketType.user)
|
||||
async def wizz(self, ctx: commands.Context):
|
||||
message6 = await ctx.send(
|
||||
f"`Wizzing {ctx.guild.name}, will take 22 seconds to complete`")
|
||||
message7 = await ctx.send(f"Changing all guild settings...")
|
||||
message5 = await ctx.send(f"Deleting **{len(ctx.guild.roles)}** Roles...")
|
||||
await asyncio.sleep(1)
|
||||
message4 = await ctx.send(
|
||||
f"Deleting **{len(ctx.guild.channels)}** Channels...")
|
||||
await asyncio.sleep(1)
|
||||
message3 = await ctx.send(f"Deleting Webhooks...")
|
||||
message2 = await ctx.send(f"Deleting emojis")
|
||||
await asyncio.sleep(1)
|
||||
message1 = await ctx.send(f"Installing Ban Wave..")
|
||||
await asyncio.sleep(1)
|
||||
await message6.delete()
|
||||
await message7.delete()
|
||||
await message5.delete()
|
||||
await message4.delete()
|
||||
await message3.delete()
|
||||
await message2.delete()
|
||||
await message1.delete()
|
||||
await ctx.send(view=CV2(f"{self.bot.user.name}", f"**{ZWARNING} Successfully Wizzed {ctx.guild.name}**"))
|
||||
|
||||
|
||||
@commands.hybrid_command(
|
||||
name="urban",
|
||||
description="Searches for specified phrase on urbandictionary",
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from discord.ext import commands, tasks
|
||||
import datetime, pytz, time as t
|
||||
from discord.ui import Button, Select, View
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import ARROWRED, BOOST, CAST, GAMES, LEVEL_UP, LOADINGRED, LOCK, MESSAGE, MINECRAFT, MUSIC, NEW, PIN, SEED, STAR, SWORD, SYSTEM, THUNDER, TICKET, WIFI, ZAI, ZARROW, ZBAN, ZBOT, ZCIRCLE, ZCIRCLE_ALT1, ZCLOUD, ZCOUNTING, ZMODULE, ZPEOPLE, ZROCKET, ZSAFE, ZTADA, ZUNMUTE, ZWRENCH
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from __future__ import annotations
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK, ZWARNING
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ui import LayoutView, MediaGallery, TextDisplay
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord import app_commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord import ui, SelectOption
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands, tasks
|
||||
import sqlite3
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import BLOBPART
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK, ZWARNING
|
||||
from discord import app_commands
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ui import View, Select, Button
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import DELETE
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import ARROWRED
|
||||
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands, tasks
|
||||
from discord import app_commands, ui, File
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import sqlite3
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import os
|
||||
import random
|
||||
import discord
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
@@ -5,6 +19,7 @@ import os
|
||||
from utils.Tools import *
|
||||
from utils.cv2 import CV2
|
||||
from discord.ui import TextDisplay, Separator, ActionRow, LayoutView, Container
|
||||
from utils.config import OWNER_IDS_STR
|
||||
|
||||
# Database setup
|
||||
db_folder = "db"
|
||||
@@ -16,7 +31,7 @@ class Nightmode(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.bot.loop.create_task(self.initialize_db())
|
||||
self.ricky = ["870179991462236170", "767979794411028491"]
|
||||
self.ricky = OWNER_IDS_STR
|
||||
self.color = 0xFF0000
|
||||
|
||||
async def initialize_db(self):
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ui import Button, View
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from discord.ext import commands, tasks
|
||||
from discord import *
|
||||
import discord
|
||||
@@ -114,7 +128,7 @@ class TimeSelect(Select):
|
||||
if role:
|
||||
await member.add_roles(role, reason="No prefix added")
|
||||
|
||||
log_channel = interaction.client.get_channel(1396794297386532978)
|
||||
log_channel = interaction.client.get_channel(LOG_CHANNEL_ID) if LOG_CHANNEL_ID else None
|
||||
if log_channel:
|
||||
embed = CV2Embed(
|
||||
title="User Added to No Prefix",
|
||||
@@ -126,7 +140,7 @@ class TimeSelect(Select):
|
||||
if self.user.avatar
|
||||
else self.user.default_avatar.url
|
||||
)
|
||||
await log_channel.send("<#1396794297386532978>", view=embed)
|
||||
await log_channel.send(view=embed)
|
||||
|
||||
embed = CV2Embed(
|
||||
description=f"**Added Global No Prefix**:\n{ZHUMAN} User: **{self.user.mention}**\n{MENTION} User Mention: {self.user.mention}\n{ZYROXSYS} User ID: {self.user.id}\n\n__**Additional Info**__:\n{ZYROXHAMMER} Added By: **{self.author.display_name}**\n{TIME} Expiry Time: {expiry_text}\n{BOOST} Timestamp: {expiry_timestamp}",
|
||||
@@ -219,7 +233,7 @@ class NoPrefix(commands.Cog):
|
||||
for user_id in expired_users:
|
||||
user = self.client.get_user(user_id)
|
||||
if user:
|
||||
log_channel = self.client.get_channel(1396794297386532978)
|
||||
log_channel = self.client.get_channel(LOG_CHANNEL_ID) if LOG_CHANNEL_ID else None
|
||||
if log_channel:
|
||||
embed_log = CV2Embed(
|
||||
title="No Prefix Expired",
|
||||
@@ -237,9 +251,7 @@ class NoPrefix(commands.Cog):
|
||||
else user.default_avatar.url
|
||||
)
|
||||
embed_log.set_footer(text="No Prefix Removal Log")
|
||||
await log_channel.send(
|
||||
"<#1396794297386532978>", view=embed_log
|
||||
)
|
||||
await log_channel.send(view=embed_log)
|
||||
bot = self.client
|
||||
guild = bot.get_guild(1401125905677553716)
|
||||
if guild:
|
||||
@@ -388,7 +400,7 @@ class NoPrefix(commands.Cog):
|
||||
embed.set_author(name="Removed No Prefix")
|
||||
await ctx.reply(view=embed)
|
||||
|
||||
log_channel = ctx.bot.get_channel(1396794297386532978)
|
||||
log_channel = ctx.bot.get_channel(LOG_CHANNEL_ID) if LOG_CHANNEL_ID else None
|
||||
if log_channel:
|
||||
embed_log = CV2Embed(
|
||||
title="No Prefix Removed",
|
||||
@@ -404,7 +416,7 @@ class NoPrefix(commands.Cog):
|
||||
url=user.display_avatar.url if user.avatar else user.default_avatar.url
|
||||
)
|
||||
embed_log.set_footer(text="No Prefix Removal Log")
|
||||
await log_channel.send("<@870179991462236170>", view=embed_log)
|
||||
await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed_log)
|
||||
|
||||
@_np.command(
|
||||
name="status", help="Check if a user is in the No Prefix list and show details."
|
||||
@@ -530,7 +542,7 @@ class NoPrefix(commands.Cog):
|
||||
description=f"**User**: **[{after}](https://discord.com/users/{after.id})** (ID: {after.id})\n**Server**: {after.guild.name}",
|
||||
color=0xFF0000,
|
||||
)
|
||||
message = await log_channel.send("<@870179991462236170>", view=embed)
|
||||
message = await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed)
|
||||
await message.publish()
|
||||
|
||||
elif before.premium_since is not None and after.premium_since is None:
|
||||
@@ -555,7 +567,7 @@ class NoPrefix(commands.Cog):
|
||||
description=f"**User**: **[{user}](https://discord.com/users/{user.id})** (ID: {user.id})\n**Server**: {user.guild.name}",
|
||||
color=0xFF0000,
|
||||
)
|
||||
message = await log_channel.send("<@870179991462236170>", view=embed)
|
||||
message = await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed)
|
||||
await message.publish()
|
||||
|
||||
async def add_np(self, user, duration):
|
||||
@@ -680,7 +692,7 @@ class NoPrefix(commands.Cog):
|
||||
await interaction.response.edit_message(view=success_embed)
|
||||
|
||||
# Log the action
|
||||
log_channel = self.client.get_channel(1396794297386532978)
|
||||
log_channel = self.client.get_channel(LOG_CHANNEL_ID) if LOG_CHANNEL_ID else None
|
||||
if log_channel:
|
||||
log_embed = CV2Embed(
|
||||
title="No-Prefix List Reset",
|
||||
@@ -688,7 +700,7 @@ class NoPrefix(commands.Cog):
|
||||
color=0xFF0000,
|
||||
)
|
||||
log_embed.set_footer(text="No Prefix Reset Log")
|
||||
await log_channel.send("<#1396794297386532978>", view=log_embed)
|
||||
await log_channel.send(view=log_embed)
|
||||
|
||||
async def no_callback(interaction):
|
||||
if interaction.user != ctx.author:
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
from __future__ import annotations
|
||||
from discord.ext import commands
|
||||
from discord import *
|
||||
@@ -10,7 +24,7 @@ import aiosqlite
|
||||
from typing import Optional
|
||||
from utils import Paginator, DescriptionEmbedPaginator, FieldPagePaginator, TextPaginator
|
||||
from utils.Tools import *
|
||||
from utils.config import OWNER_IDS
|
||||
from utils.config import OWNER_IDS, BOT_OWNER_IDS
|
||||
from utils.emoji import BOOSTS, DISCORD_BADGE_EMOJIS, LOADINGRED, NITRO_BOOST, TICK, ZWARNING
|
||||
from core import Cog, zyrox, Context
|
||||
import sqlite3
|
||||
@@ -18,7 +32,7 @@ import os
|
||||
import requests
|
||||
import numpy as np
|
||||
from io import BytesIO
|
||||
from utils.config import OWNER_IDS
|
||||
from utils.config import OWNER_IDS, BOT_OWNER_IDS
|
||||
from discord.errors import Forbidden
|
||||
from discord import Embed
|
||||
from discord.ui import Button, View
|
||||
@@ -28,7 +42,7 @@ from utils.config import *
|
||||
|
||||
|
||||
# --- Configuration & Helpers ---
|
||||
OWNER_IDS = [1258831252748894436]
|
||||
# OWNER_IDS and BOT_OWNER_IDS are imported from utils.config — edit .env to change them
|
||||
|
||||
# Your custom bot badges, including Family and Developer
|
||||
BADGE_URLS = {
|
||||
@@ -124,7 +138,7 @@ class Owner(commands.Cog):
|
||||
self.np_cache = []
|
||||
self.db_path = 'db/np.db'
|
||||
self.stop_tour = False
|
||||
self.bot_owner_ids = [870179991462236170,1432771000629596225,1382744437049790495]
|
||||
self.bot_owner_ids = BOT_OWNER_IDS
|
||||
self.client.loop.create_task(self.setup_database())
|
||||
self.client.loop.create_task(self.load_staff())
|
||||
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ui import Button, View
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from utils.cv2 import CV2
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CROSS, TICK
|
||||
from discord.ext import commands
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import random
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import CODEBASE, LOADING, SYSTEM, THUNDER, ZYROX_CODE, ZYROX_COMMAND, ZYROX_GLOBAL, ZYROX_OWNER, ZYROX_SEARCH
|
||||
import psutil
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
|
||||
import discord
|
||||
from utils.emoji import DND, ICON_BROWSER, IDLE, LOADING_ALT1, MOBILE, OFFLINE, ONLINE, PC
|
||||
from discord.ext import commands
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user