Update project configuration files, and API routes accordingly. Add SQLite runtime file ignores to .gitignore for better file management.
This commit is contained in:
76
.github/workflows/ci.yml
vendored
Normal file
76
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master]
|
||||||
|
pull_request:
|
||||||
|
branches: [main, master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bot:
|
||||||
|
name: Bot (Python)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: bot
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
cache: pip
|
||||||
|
cache-dependency-path: bot/requirements.txt
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Syntax check
|
||||||
|
run: python -m compileall -q -x 'leveling_original' .
|
||||||
|
|
||||||
|
- name: Import smoke test
|
||||||
|
env:
|
||||||
|
TOKEN: test
|
||||||
|
OWNER_IDS: "123456789012345678"
|
||||||
|
API_ENABLED: "false"
|
||||||
|
TUNNEL_ENABLED: "false"
|
||||||
|
run: |
|
||||||
|
python - <<'PY'
|
||||||
|
from core.hexahost import HexaHost
|
||||||
|
from api.server import create_app
|
||||||
|
bot = HexaHost()
|
||||||
|
create_app()
|
||||||
|
import cogs
|
||||||
|
print("imports ok")
|
||||||
|
PY
|
||||||
|
|
||||||
|
dashboard:
|
||||||
|
name: Dashboard (Next.js)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: dashboard
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "20"
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: dashboard/package-lock.json
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
DASHBOARD_API_URL: http://127.0.0.1:8000/api/v1
|
||||||
|
DASHBOARD_API_KEY: ci-test-key
|
||||||
|
NEXTAUTH_URL: http://localhost:3000
|
||||||
|
NEXTAUTH_SECRET: ci-test-secret-min-32-chars-long!!
|
||||||
|
DISCORD_CLIENT_ID: "0"
|
||||||
|
DISCORD_CLIENT_SECRET: ci-secret
|
||||||
|
run: npm run build
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -47,8 +47,12 @@ build/
|
|||||||
.env.local
|
.env.local
|
||||||
.env.*.local
|
.env.*.local
|
||||||
|
|
||||||
|
# Ignore SQLite runtime files
|
||||||
|
bot/db/**/*.db-journal
|
||||||
|
|
||||||
# Ignore node_modules
|
# Ignore node_modules
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
# Ignore Next.js build output
|
# Ignore Next.js build output
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
| Field | Value |
|
| Field | Value |
|
||||||
|-------|-------|
|
|-------|-------|
|
||||||
| **Report ID** | ZYROX-SEC-2026-001 |
|
| **Report ID** | ZYROX-SEC-2026-001 |
|
||||||
| **Target** | ZyroX CV2 AIO Discord Bot with Dashboard |
|
| **Target** | HexaHost CV2 AIO Discord Bot with Dashboard |
|
||||||
| **Repository** | `ZyroX-CV2-AIO-With-Dashboard-main` |
|
| **Repository** | `HexaHost-CV2-AIO-With-Dashboard-main` |
|
||||||
| **Assessment Date** | 2026-07-21 |
|
| **Assessment Date** | 2026-07-21 |
|
||||||
| **Report Version** | 1.0 |
|
| **Report Version** | 1.0 |
|
||||||
| **Classification** | Internal — Distribution Restricted |
|
| **Classification** | Internal — Distribution Restricted |
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
## 1. Executive Summary
|
## 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.
|
A security review of the HexaHost CV2 AIO Discord bot (originally published by HexaHost) was conducted to determine whether the repository contains malicious code and to identify exploitable misconfigurations.
|
||||||
|
|
||||||
### 1.1 Malware Classification
|
### 1.1 Malware Classification
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ A security review of the ZyroX CV2 AIO Discord bot (originally published by Code
|
|||||||
```
|
```
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ Trust Boundary │
|
│ Trust Boundary │
|
||||||
Discord Users ───►│ discord.py Gateway (bot/CodeX.py) │
|
Discord Users ───►│ discord.py Gateway (bot/HexaHost.py) │
|
||||||
│ │ │ │
|
│ │ │ │
|
||||||
│ ▼ ▼ │
|
│ ▼ ▼ │
|
||||||
│ SQLite (bot/db/) FastAPI :8000 │
|
│ SQLite (bot/db/) FastAPI :8000 │
|
||||||
@@ -153,7 +153,7 @@ OWNER_IDS: list[int] = _parse_ids("OWNER_IDS", [870179991462236170])
|
|||||||
| **CVSS 3.1 (est.)** | 9.8 (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) |
|
| **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) |
|
| **Status at review** | Open → Remediated (#2) |
|
||||||
|
|
||||||
**Affected component:** `bot/CodeX.py` (~L345)
|
**Affected component:** `bot/HexaHost.py` (~L345)
|
||||||
|
|
||||||
```python
|
```python
|
||||||
await client.load_extension("jishaku")
|
await client.load_extension("jishaku")
|
||||||
@@ -176,7 +176,7 @@ await client.load_extension("jishaku")
|
|||||||
| **CVSS 3.1 (est.)** | 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) |
|
| **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) |
|
| **Status at review** | Open → Remediated (#3) |
|
||||||
|
|
||||||
**Affected component:** `bot/CodeX.py` → `on_command_completion`
|
**Affected component:** `bot/HexaHost.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.
|
**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.
|
||||||
|
|
||||||
@@ -198,9 +198,9 @@ await client.load_extension("jishaku")
|
|||||||
|
|
||||||
| File | Channel ID | Function |
|
| File | Channel ID | Function |
|
||||||
|------|------------|----------|
|
|------|------------|----------|
|
||||||
| `bot/CodeX.py` | `1396794297386532978` | Guild join notifications |
|
| `bot/HexaHost.py` | `1396794297386532978` | Guild join notifications |
|
||||||
| `bot/CodeX.py` | `1419729255977189467` | Server count display |
|
| `bot/HexaHost.py` | `1419729255977189467` | Server count display |
|
||||||
| `bot/CodeX.py` | `1419729283861184632` | Member count display |
|
| `bot/HexaHost.py` | `1419729283861184632` | Member count display |
|
||||||
| `bot/cogs/events/on_guild.py` | `1396794297386532978` | Join/leave detail logs |
|
| `bot/cogs/events/on_guild.py` | `1396794297386532978` | Join/leave detail logs |
|
||||||
| `bot/cogs/commands/np.py` | `1396794297386532978` | No-prefix command audit |
|
| `bot/cogs/commands/np.py` | `1396794297386532978` | No-prefix command audit |
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ await client.load_extension("jishaku")
|
|||||||
| **CWE** | [CWE-284](https://cwe.mitre.org/data/definitions/284.html) — Improper Access Control |
|
| **CWE** | [CWE-284](https://cwe.mitre.org/data/definitions/284.html) — Improper Access Control |
|
||||||
| **Status at review** | Open → Partially remediated (#5, #10) |
|
| **Status at review** | Open → Partially remediated (#5, #10) |
|
||||||
|
|
||||||
**Affected components:** `bot/api/server.py`, `bot/utils/tunnel.py`, `bot/CodeX.py`
|
**Affected components:** `bot/api/server.py`, `bot/utils/tunnel.py`, `bot/HexaHost.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).
|
**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).
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ const API_KEY = process.env.NEXT_PUBLIC_DASHBOARD_API_KEY;
|
|||||||
| **Severity** | Low / Informational |
|
| **Severity** | Low / Informational |
|
||||||
| **Status at review** | Acknowledged — no code change required |
|
| **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.
|
**Description:** >100 files contain legacy branding headers (`discord.gg/hexahost`). Commented `autoblacklist` cog references external support channel. Help footers link to developer Discord.
|
||||||
|
|
||||||
**Impact:** No direct exploitation path; increases fingerprinting and social-trust surface.
|
**Impact:** No direct exploitation path; increases fingerprinting and social-trust surface.
|
||||||
|
|
||||||
@@ -388,8 +388,8 @@ const API_KEY = process.env.NEXT_PUBLIC_DASHBOARD_API_KEY;
|
|||||||
|
|
||||||
| Component | Role |
|
| Component | Role |
|
||||||
|-----------|------|
|
|-----------|------|
|
||||||
| `CodeX.py` | Process entry: bot, API thread, optional tunnel |
|
| `HexaHost.py` | Process entry: bot, API thread, optional tunnel |
|
||||||
| `core/zyrox.py` | `AutoShardedBot` subclass, prefix resolution |
|
| `core/hexahost.py` | `AutoShardedBot` subclass, prefix resolution |
|
||||||
| `utils/config.py` | Centralized environment configuration |
|
| `utils/config.py` | Centralized environment configuration |
|
||||||
| `api/` | FastAPI REST layer for dashboard |
|
| `api/` | FastAPI REST layer for dashboard |
|
||||||
| `cogs/` | Feature modules (~80+ extensions) |
|
| `cogs/` | Feature modules (~80+ extensions) |
|
||||||
@@ -454,7 +454,7 @@ All databases are local SQLite files under `bot/db/`. No encryption at rest obse
|
|||||||
## Appendix D — Startup Sequence
|
## Appendix D — Startup Sequence
|
||||||
|
|
||||||
```
|
```
|
||||||
python bot/CodeX.py
|
python bot/HexaHost.py
|
||||||
├─ load_dotenv()
|
├─ load_dotenv()
|
||||||
├─ FastAPI thread (if API_ENABLED)
|
├─ FastAPI thread (if API_ENABLED)
|
||||||
├─ Cloudflare tunnel (if TUNNEL_ENABLED)
|
├─ Cloudflare tunnel (if TUNNEL_ENABLED)
|
||||||
@@ -473,7 +473,7 @@ npm run dev (dashboard/)
|
|||||||
|
|
||||||
## 6. Conclusion
|
## 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.
|
HexaHost 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.
|
Operators treating this as production software must treat initial configuration as a **security-critical step**, equivalent to key ceremony for any SaaS deployment.
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Summary
|
## 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).
|
Security audit and hardening of the HexaHost CV2 AIO Discord bot with dashboard. The analysis found **no classic malware**, but several **backdoor-like mechanisms** in the original legacy 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.
|
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.
|
||||||
|
|
||||||
|
|||||||
47
README.md
47
README.md
@@ -1,12 +1,9 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
```
|
```
|
||||||
███████╗██╗ ██╗██████╗ ██████╗ ██╗ ██╗
|
+-+-+-+-+-+-+-+-+
|
||||||
╚══███╔╝╚██╗ ██╔╝██╔══██╗██╔═══██╗╚██╗██╔╝
|
|H|e|x|a|H|o|s|t|
|
||||||
███╔╝ ╚████╔╝ ██████╔╝██║ ██║ ╚███╔╝
|
+-+-+-+-+-+-+-+-+
|
||||||
███╔╝ ╚██╔╝ ██╔══██╗██║ ██║ ██╔██╗
|
|
||||||
███████╗ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗
|
|
||||||
╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<h3>A feature-rich Discord bot paired with a sleek Next.js dashboard</h3>
|
<h3>A feature-rich Discord bot paired with a sleek Next.js dashboard</h3>
|
||||||
@@ -21,9 +18,8 @@
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-red?style=for-the-badge"/></a>
|
<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://discord.gg/hexahost"><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/theoneandonlymace"><img src="https://img.shields.io/badge/GitHub-theoneandonlymace-181717?style=for-the-badge&logo=github&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>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -32,10 +28,10 @@
|
|||||||
|
|
||||||
## ✦ Overview
|
## ✦ Overview
|
||||||
|
|
||||||
ZyroX is a fully-featured Discord bot with a modern web dashboard for managing everything from antinuke to music. Built on `discord.py v2`, `FastAPI`, and `Next.js 14` with Tailwind CSS.
|
HexaHost is a fully-featured Discord bot with a modern web dashboard for managing everything from antinuke to music. Built on `discord.py v2`, `FastAPI`, and `Next.js 14` with Tailwind CSS.
|
||||||
|
|
||||||
```
|
```
|
||||||
ZyroX-CV2-With-Dashboard/
|
HexaHost-CV2-With-Dashboard/
|
||||||
├── 🤖 bot/ Python Discord bot + FastAPI backend
|
├── 🤖 bot/ Python Discord bot + FastAPI backend
|
||||||
│ ├── api/ Dashboard REST API (FastAPI)
|
│ ├── api/ Dashboard REST API (FastAPI)
|
||||||
│ ├── cogs/ All bot features (commands, events, antinuke, automod…)
|
│ ├── cogs/ All bot features (commands, events, antinuke, automod…)
|
||||||
@@ -43,7 +39,7 @@ ZyroX-CV2-With-Dashboard/
|
|||||||
│ ├── utils/ Shared utilities (emoji, tools, sync, cloudflare tunnel…)
|
│ ├── utils/ Shared utilities (emoji, tools, sync, cloudflare tunnel…)
|
||||||
│ ├── games/ Standalone game modules
|
│ ├── games/ Standalone game modules
|
||||||
│ ├── assets/ Fonts, backgrounds, GIFs
|
│ ├── assets/ Fonts, backgrounds, GIFs
|
||||||
│ └── CodeX.py Entry point
|
│ └── HexaHost.py Entry point
|
||||||
│
|
│
|
||||||
└── 🌐 dashboard/ Next.js frontend
|
└── 🌐 dashboard/ Next.js frontend
|
||||||
├── app/ App Router pages & API routes
|
├── app/ App Router pages & API routes
|
||||||
@@ -122,7 +118,7 @@ ZyroX-CV2-With-Dashboard/
|
|||||||
- Slash + prefix commands
|
- Slash + prefix commands
|
||||||
- FastAPI backend with API key auth + rate limiting
|
- FastAPI backend with API key auth + rate limiting
|
||||||
- Cloudflare Tunnel — unlimited bandwidth, permanent URL, zero system installs
|
- Cloudflare Tunnel — unlimited bandwidth, permanent URL, zero system installs
|
||||||
- CodeX Devs watermark on every source file
|
- HexaHost watermark on every source file
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -148,8 +144,8 @@ ZyroX-CV2-With-Dashboard/
|
|||||||
**1 — Clone the repo**
|
**1 — Clone the repo**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/RayExo/ZyroX-CV2-With-Dashboard
|
git clone https://github.com/theoneandonlymace/HexaHost-CV2-With-Dashboard
|
||||||
cd ZyroX-CV2-With-Dashboard/bot
|
cd HexaHost-CV2-With-Dashboard/bot
|
||||||
```
|
```
|
||||||
|
|
||||||
**2 — Install dependencies**
|
**2 — Install dependencies**
|
||||||
@@ -173,7 +169,7 @@ Copy `.env.example` to `.env` and fill in the values:
|
|||||||
```env
|
```env
|
||||||
# ── Core ──────────────────────────────────────────────────────────
|
# ── Core ──────────────────────────────────────────────────────────
|
||||||
TOKEN = your_discord_bot_token
|
TOKEN = your_discord_bot_token
|
||||||
brand_name = 'ZyroX'
|
brand_name = 'HexaHost'
|
||||||
|
|
||||||
# ── Owner IDs (REQUIRED — your Discord user ID) ───────────────────
|
# ── Owner IDs (REQUIRED — your Discord user ID) ───────────────────
|
||||||
OWNER_IDS = YOUR_DISCORD_USER_ID_HERE
|
OWNER_IDS = YOUR_DISCORD_USER_ID_HERE
|
||||||
@@ -207,7 +203,7 @@ CF_TUNNEL_URL = "https://api.yourdomain.com"
|
|||||||
**4 — Run the bot**
|
**4 — Run the bot**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python CodeX.py
|
python HexaHost.py
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -237,7 +233,7 @@ DISCORD_CLIENT_SECRET = your_discord_oauth_client_secret
|
|||||||
|
|
||||||
ADMIN_IDS = your_discord_user_id
|
ADMIN_IDS = your_discord_user_id
|
||||||
NEXT_PUBLIC_ADMIN_IDS = your_discord_user_id
|
NEXT_PUBLIC_ADMIN_IDS = your_discord_user_id
|
||||||
NEXT_PUBLIC_BRAND_NAME = "ZyroX"
|
NEXT_PUBLIC_BRAND_NAME = "HexaHost"
|
||||||
NEXT_PUBLIC_BRAND_NAME_WORD = "ZX"
|
NEXT_PUBLIC_BRAND_NAME_WORD = "ZX"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -309,7 +305,7 @@ The bot uses **pycloudflared** — a Python package that downloads the `cloudfla
|
|||||||
**Setup (browser only, no CLI needed):**
|
**Setup (browser only, no CLI needed):**
|
||||||
|
|
||||||
1. Go to [one.dash.cloudflare.com](https://one.dash.cloudflare.com) → **Networks → Tunnels → Create a tunnel**
|
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
|
2. Choose **Cloudflared**, give it a name (e.g. `hexahost-api`), save
|
||||||
3. On the **Install connector** step, copy the token from the command shown:
|
3. On the **Install connector** step, copy the token from the command shown:
|
||||||
```
|
```
|
||||||
cloudflared tunnel run --token <COPY_THIS>
|
cloudflared tunnel run --token <COPY_THIS>
|
||||||
@@ -336,7 +332,7 @@ On every startup the console prints:
|
|||||||
### 🤖 Bot — any Python host
|
### 🤖 Bot — any Python host
|
||||||
|
|
||||||
1. Upload the entire `bot/` folder to your host (Pterodactyl, 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`
|
2. Set the start command to `python HexaHost.py`
|
||||||
3. Add all environment variables
|
3. Add all environment variables
|
||||||
4. `pycloudflared` downloads the binary automatically on first run — no extra steps
|
4. `pycloudflared` downloads the binary automatically on first run — no extra steps
|
||||||
|
|
||||||
@@ -407,19 +403,18 @@ Runs automatically on startup when `EMOJI_SYNC=true`:
|
|||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
## ✦ CodeX Devs
|
## ✦ HexaHost
|
||||||
|
|
||||||
*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>
|
<a href="https://discord.gg/hexahost"><img src="https://discord.com/api/guilds/1301573144817045524/widget.png?style=banner2" alt="HexaHost Discord Server" width="480"/></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://discord.gg/hexahost"><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/theoneandonlymace"><img src="https://img.shields.io/badge/GitHub-theoneandonlymace-181717?style=for-the-badge&logo=github&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>
|
<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>
|
</p>
|
||||||
|
|
||||||
© 2026 CodeX Devs — MIT License
|
© 2026 HexaHost — MIT License
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
| **Publication Date** | 2026-07-21 |
|
| **Publication Date** | 2026-07-21 |
|
||||||
| **Status** | Patches applied — operator action required |
|
| **Status** | Patches applied — operator action required |
|
||||||
| **Classification** | Internal — Distribution Restricted |
|
| **Classification** | Internal — Distribution Restricted |
|
||||||
| **Affected Product** | ZyroX CV2 AIO Discord Bot with Dashboard |
|
| **Affected Product** | HexaHost CV2 AIO Discord Bot with Dashboard |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ This document tracks remediation of findings identified during static security a
|
|||||||
| File | Change |
|
| File | Change |
|
||||||
|------|--------|
|
|------|--------|
|
||||||
| `bot/utils/config.py` | `_parse_ids()` returns empty list on missing env var |
|
| `bot/utils/config.py` | `_parse_ids()` returns empty list on missing env var |
|
||||||
| `bot/CodeX.py` | Startup warning when `OWNER_IDS` is empty |
|
| `bot/HexaHost.py` | Startup warning when `OWNER_IDS` is empty |
|
||||||
| `bot/.env.example` | Placeholder `YOUR_DISCORD_USER_ID_HERE`; foreign IDs removed |
|
| `bot/.env.example` | Placeholder `YOUR_DISCORD_USER_ID_HERE`; foreign IDs removed |
|
||||||
| `dashboard/.env.example` | `ADMIN_IDS` placeholder replaces foreign ID |
|
| `dashboard/.env.example` | `ADMIN_IDS` placeholder replaces foreign ID |
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ OWNER_IDS=<your_discord_snowflake>
|
|||||||
| File | Change |
|
| File | Change |
|
||||||
|------|--------|
|
|------|--------|
|
||||||
| `bot/utils/config.py` | `JISHAKU_ENABLED` flag (default: `false`) |
|
| `bot/utils/config.py` | `JISHAKU_ENABLED` flag (default: `false`) |
|
||||||
| `bot/CodeX.py` | Conditional extension load |
|
| `bot/HexaHost.py` | Conditional extension load |
|
||||||
| `bot/.env.example` | Documented opt-in flag |
|
| `bot/.env.example` | Documented opt-in flag |
|
||||||
|
|
||||||
**Post-patch behavior:** Jishaku inactive unless `JISHAKU_ENABLED=true`. Recommended for local debugging only.
|
**Post-patch behavior:** Jishaku inactive unless `JISHAKU_ENABLED=true`. Recommended for local debugging only.
|
||||||
@@ -82,7 +82,7 @@ OWNER_IDS=<your_discord_snowflake>
|
|||||||
| File | Change |
|
| File | Change |
|
||||||
|------|--------|
|
|------|--------|
|
||||||
| `bot/utils/config.py` | `_valid_webhook_url()` rejects empty/placeholder values |
|
| `bot/utils/config.py` | `_valid_webhook_url()` rejects empty/placeholder values |
|
||||||
| `bot/CodeX.py` | `on_command_completion` early-return when URL invalid |
|
| `bot/HexaHost.py` | `on_command_completion` early-return when URL invalid |
|
||||||
|
|
||||||
**Post-patch behavior:** No outbound command telemetry without fully qualified, operator-configured webhook URL.
|
**Post-patch behavior:** No outbound command telemetry without fully qualified, operator-configured webhook URL.
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ OWNER_IDS=<your_discord_snowflake>
|
|||||||
| File | Change |
|
| File | Change |
|
||||||
|------|--------|
|
|------|--------|
|
||||||
| `bot/utils/config.py` | `LOG_CHANNEL_ID`, `SERVER_COUNT_CHANNEL_ID`, `USER_COUNT_CHANNEL_ID` |
|
| `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/HexaHost.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/events/on_guild.py` | Join/leave logging conditional on `LOG_CHANNEL_ID` |
|
||||||
| `bot/cogs/commands/np.py` | Audit logs use `LOG_CHANNEL_ID` |
|
| `bot/cogs/commands/np.py` | Audit logs use `LOG_CHANNEL_ID` |
|
||||||
| `bot/.env.example` | Optional IDs documented (commented) |
|
| `bot/.env.example` | Optional IDs documented (commented) |
|
||||||
@@ -120,7 +120,7 @@ USER_COUNT_CHANNEL_ID=<channel_snowflake>
|
|||||||
| File | Change |
|
| File | Change |
|
||||||
|------|--------|
|
|------|--------|
|
||||||
| `bot/utils/config.py` | `API_ENABLED=false`, `API_HOST=127.0.0.1`, `TUNNEL_ENABLED=false` |
|
| `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/HexaHost.py` | Bind to `API_HOST`; warn on `0.0.0.0` |
|
||||||
| `bot/.env.example` | Secure defaults documented |
|
| `bot/.env.example` | Secure defaults documented |
|
||||||
|
|
||||||
**Post-patch behavior:** API and tunnel disabled until explicitly enabled. Localhost binding by default.
|
**Post-patch behavior:** API and tunnel disabled until explicitly enabled. Localhost binding by default.
|
||||||
@@ -200,7 +200,7 @@ Remove `NEXT_PUBLIC_DASHBOARD_API_KEY` from any existing `.env`.
|
|||||||
| File | Change |
|
| File | Change |
|
||||||
|------|--------|
|
|------|--------|
|
||||||
| `bot/cogs/commands/general.py` | Removed `hack`, `token`, `wizz`; dead code cleanup |
|
| `bot/cogs/commands/general.py` | Removed `hack`, `token`, `wizz`; dead code cleanup |
|
||||||
| `bot/cogs/zyrox/general.py` | Help index updated |
|
| `bot/cogs/hexahost/general.py` | Help index updated |
|
||||||
|
|
||||||
**Post-patch behavior:** Commands no longer registered. No regression in remaining general commands.
|
**Post-patch behavior:** Commands no longer registered. No regression in remaining general commands.
|
||||||
|
|
||||||
@@ -234,8 +234,8 @@ Secondary pass on remediation code identified gaps in the initial proxy implemen
|
|||||||
| API proxy accessible without session | Critical | Session gate + guild/admin validation in proxy route |
|
| 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 |
|
| 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 |
|
| `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` |
|
| `on_command_completion` NullPointer on `command is None` | Medium | Guard clause in `HexaHost.py` |
|
||||||
| Orphaned `jishaku` import in `bot/core/zyrox.py` | Low | Import removed |
|
| Orphaned `jishaku` import in `bot/core/hexahost.py` | Low | Import removed |
|
||||||
| Admin check relied solely on `NEXT_PUBLIC_ADMIN_IDS` | Medium | Server-side `ADMIN_IDS` supported |
|
| Admin check relied solely on `NEXT_PUBLIC_ADMIN_IDS` | Medium | Server-side `ADMIN_IDS` supported |
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -274,8 +274,8 @@ Execute after pulling patched codebase:
|
|||||||
| Item | Rationale | Risk Level |
|
| Item | Rationale | Risk Level |
|
||||||
|------|-----------|------------|
|
|------|-----------|------------|
|
||||||
| Developer credits in `mention.py`, `stats.py` | Cosmetic attribution | Informational |
|
| Developer credits in `mention.py`, `stats.py` | Cosmetic attribution | Informational |
|
||||||
| CodeX file headers | Branding | Informational |
|
| Legacy file headers | Branding | Informational |
|
||||||
| `discord.gg/codexdev` in welcome templates | Operator-configurable content | Informational |
|
| `discord.gg/hexahost` in welcome templates | Operator-configurable content | Informational |
|
||||||
|
|
||||||
These items do not constitute exploitable vulnerabilities under the assessed threat model.
|
These items do not constitute exploitable vulnerabilities under the assessed threat model.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
TOKEN=TOKEN_HERE
|
TOKEN=TOKEN_HERE
|
||||||
brand_name='ZyroX'
|
brand_name='HexaHost'
|
||||||
NEXT_PUBLIC_BRAND_NAME='ZyroX'
|
NEXT_PUBLIC_BRAND_NAME='HexaHost'
|
||||||
|
|
||||||
|
# ── Multiple instances (optional) ─────────────────────────────────────────────
|
||||||
|
# Run several bot processes on one host — each needs its own .env / TOKEN / API_PORT.
|
||||||
|
# BOT_INSTANCE_ID isolates all SQLite + jsondb files under bot/db/<id>/ (and jsondb subfolder).
|
||||||
|
# Leave unset for normal single-bot operation (paths stay bot/db/*.db and bot/jsondb/*.json).
|
||||||
|
# BOT_INSTANCE_ID=prod-a
|
||||||
|
# API_PORT=8001
|
||||||
|
|
||||||
# ── Owner / Staff IDs (REQUIRED — comma-separated Discord user IDs) ───────────
|
# ── Owner / Staff IDs (REQUIRED — comma-separated Discord user IDs) ───────────
|
||||||
# Set your own Discord user ID(s). No foreign IDs are used as fallback.
|
# Set your own Discord user ID(s). No foreign IDs are used as fallback.
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -29,7 +28,7 @@ from discord.ext import commands, tasks
|
|||||||
|
|
||||||
from core import Context
|
from core import Context
|
||||||
from core.Cog import Cog
|
from core.Cog import Cog
|
||||||
from core.zyrox import zyrox
|
from core.hexahost import HexaHost
|
||||||
from utils.Tools import *
|
from utils.Tools import *
|
||||||
from utils.config import *
|
from utils.config import *
|
||||||
from utils.emoji import SUCCESS, ERROR, TICK, CROSS, REACTION_TEST_EMOJIS
|
from utils.emoji import SUCCESS, ERROR, TICK, CROSS, REACTION_TEST_EMOJIS
|
||||||
@@ -51,7 +50,7 @@ if not OWNER_IDS:
|
|||||||
print("\033[33m⚠ OWNER_IDS is not set in .env — no bot owners configured.\033[0m")
|
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")
|
print("\033[33m Set OWNER_IDS=YOUR_DISCORD_USER_ID before running in production.\033[0m")
|
||||||
|
|
||||||
client = zyrox()
|
client = HexaHost()
|
||||||
tree = client.tree
|
tree = client.tree
|
||||||
|
|
||||||
# --- Background Task for Stats ---
|
# --- Background Task for Stats ---
|
||||||
@@ -87,12 +86,9 @@ async def on_ready():
|
|||||||
|
|
||||||
print("""
|
print("""
|
||||||
\033[1;31m
|
\033[1;31m
|
||||||
██████╗ ██████╗ ██████╗ ███████╗██╗ ██╗
|
+-+-+-+-+-+-+-+-+-+
|
||||||
██╔════╝██╔═══██╗██╔══██╗██╔════╝╚██╗██╔╝
|
|H|e|x|a|H|o|s|t|
|
||||||
██║ ██║ ██║██║ ██║█████╗ ╚███╔╝
|
+-+-+-+-+-+-+-+-+-+
|
||||||
██║ ██║ ██║██║ ██║██╔══╝ ██╔██╗
|
|
||||||
╚██████╗╚██████╔╝██████╔╝███████╗██╔╝ ██╗
|
|
||||||
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝
|
|
||||||
\033[0m
|
\033[0m
|
||||||
""")
|
""")
|
||||||
print("Loaded & Online!")
|
print("Loaded & Online!")
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2026 CodeX Devs
|
Copyright (c) 2026 HexaHost
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
```
|
```
|
||||||
███████╗██╗ ██╗██████╗ ██████╗ ██╗ ██╗
|
+-+-+-+-+-+-+-+-+
|
||||||
╚══███╔╝╚██╗ ██╔╝██╔══██╗██╔═══██╗╚██╗██╔╝
|
|H|e|x|a|H|o|s|t|
|
||||||
███╔╝ ╚████╔╝ ██████╔╝██║ ██║ ╚███╔╝
|
+-+-+-+-+-+-+-+-+
|
||||||
███╔╝ ╚██╔╝ ██╔══██╗██║ ██║ ██╔██╗
|
|
||||||
███████╗ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗
|
|
||||||
╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<h3>ZyroX Bot — Python Discord Bot + FastAPI Backend</h3>
|
<h3>HexaHost 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>
|
<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>
|
||||||
|
|
||||||
@@ -20,9 +17,8 @@
|
|||||||
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-red?style=for-the-badge"/></a>
|
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-red?style=for-the-badge"/></a>
|
||||||
</p>
|
</p>
|
||||||
<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://discord.gg/hexahost"><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/theoneandonlymace"><img src="https://img.shields.io/badge/GitHub-theoneandonlymace-181717?style=for-the-badge&logo=github&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>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -31,7 +27,7 @@
|
|||||||
|
|
||||||
## ✦ Overview
|
## ✦ 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.
|
This folder contains the HexaHost Discord bot built on `discord.py v2` alongside a `FastAPI` backend that powers the web dashboard. Everything runs from a single `python HexaHost.py` command.
|
||||||
|
|
||||||
```
|
```
|
||||||
bot/
|
bot/
|
||||||
@@ -43,12 +39,12 @@ bot/
|
|||||||
│ ├── commands/ All slash & prefix command modules
|
│ ├── commands/ All slash & prefix command modules
|
||||||
│ ├── events/ General Discord event listeners
|
│ ├── events/ General Discord event listeners
|
||||||
│ ├── moderation/ Moderation action modules
|
│ ├── moderation/ Moderation action modules
|
||||||
│ └── zyrox/ Core ZyroX feature cogs
|
│ └── hexahost/ Core HexaHost feature cogs
|
||||||
├── core/ Bot client, context, cog base classes
|
├── core/ Bot client, context, cog base classes
|
||||||
├── games/ Standalone game logic + button views
|
├── games/ Standalone game logic + button views
|
||||||
├── utils/ Emoji, tools, sync, Cloudflare tunnel
|
├── utils/ Emoji, tools, sync, Cloudflare tunnel
|
||||||
├── assets/ Fonts, backgrounds, GIFs
|
├── assets/ Fonts, backgrounds, GIFs
|
||||||
└── CodeX.py Entry point
|
└── HexaHost.py Entry point
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -136,7 +132,7 @@ bot/
|
|||||||
- Slash + prefix commands
|
- Slash + prefix commands
|
||||||
- Cloudflare Tunnel via pycloudflared — zero system installs, unlimited traffic
|
- Cloudflare Tunnel via pycloudflared — zero system installs, unlimited traffic
|
||||||
- Single `OWNER_IDS` env var controls all permission checks
|
- Single `OWNER_IDS` env var controls all permission checks
|
||||||
- CodeX Devs watermark on every source file
|
- HexaHost watermark on every source file
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -178,7 +174,7 @@ Create a `.env` file (copy from `.env.example`):
|
|||||||
```env
|
```env
|
||||||
# ── Core ──────────────────────────────────────────────────────────
|
# ── Core ──────────────────────────────────────────────────────────
|
||||||
TOKEN = your_discord_bot_token
|
TOKEN = your_discord_bot_token
|
||||||
brand_name = 'ZyroX'
|
brand_name = 'HexaHost'
|
||||||
|
|
||||||
# ── Owner IDs (REQUIRED — your Discord user ID) ───────────────────
|
# ── Owner IDs (REQUIRED — your Discord user ID) ───────────────────
|
||||||
OWNER_IDS = YOUR_DISCORD_USER_ID_HERE
|
OWNER_IDS = YOUR_DISCORD_USER_ID_HERE
|
||||||
@@ -212,7 +208,7 @@ CF_TUNNEL_URL = "https://api.yourdomain.com"
|
|||||||
### 3 — Run
|
### 3 — Run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python CodeX.py
|
python HexaHost.py
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -262,7 +258,7 @@ Uses **pycloudflared** — downloads the `cloudflared` binary automatically on f
|
|||||||
**Setup (browser only — no CLI needed):**
|
**Setup (browser only — no CLI needed):**
|
||||||
|
|
||||||
1. Go to [one.dash.cloudflare.com](https://one.dash.cloudflare.com) → **Networks → Tunnels → Create a tunnel**
|
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
|
2. Choose **Cloudflared**, name it (e.g. `hexahost-api`), save
|
||||||
3. On **Install connector**, copy the token from the command shown:
|
3. On **Install connector**, copy the token from the command shown:
|
||||||
```
|
```
|
||||||
cloudflared tunnel run --token <COPY_THIS_TOKEN>
|
cloudflared tunnel run --token <COPY_THIS_TOKEN>
|
||||||
@@ -304,7 +300,7 @@ When `EMOJI_SYNC=true`, the bot syncs application emojis on every startup:
|
|||||||
Upload the entire `bot/` folder to your host and set the start command to:
|
Upload the entire `bot/` folder to your host and set the start command to:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python CodeX.py
|
python HexaHost.py
|
||||||
```
|
```
|
||||||
|
|
||||||
`pycloudflared` downloads the binary on first run — no extra steps on any host.
|
`pycloudflared` downloads the binary on first run — no extra steps on any host.
|
||||||
@@ -331,19 +327,18 @@ python CodeX.py
|
|||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
## ✦ CodeX Devs
|
## ✦ HexaHost
|
||||||
|
|
||||||
*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>
|
<a href="https://discord.gg/hexahost"><img src="https://discord.com/api/guilds/1301573144817045524/widget.png?style=banner2" alt="HexaHost Discord Server" width="480"/></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://discord.gg/hexahost"><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/theoneandonlymace"><img src="https://img.shields.io/badge/GitHub-theoneandonlymace-181717?style=for-the-badge&logo=github&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>
|
<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>
|
</p>
|
||||||
|
|
||||||
© 2026 CodeX Devs — MIT License
|
© 2026 HexaHost — MIT License
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -16,6 +15,8 @@ import aiosqlite
|
|||||||
import asyncio
|
import asyncio
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
|
from utils.db_paths import resolve_db_path
|
||||||
|
|
||||||
class DatabaseManager:
|
class DatabaseManager:
|
||||||
"""
|
"""
|
||||||
A simple manager for persistent SQLite connections to avoid
|
A simple manager for persistent SQLite connections to avoid
|
||||||
@@ -29,6 +30,7 @@ class DatabaseManager:
|
|||||||
"""
|
"""
|
||||||
Retrieves an existing connection or creates a new one for the given path.
|
Retrieves an existing connection or creates a new one for the given path.
|
||||||
"""
|
"""
|
||||||
|
db_path = resolve_db_path(db_path)
|
||||||
async with self._lock:
|
async with self._lock:
|
||||||
if db_path not in self._connections:
|
if db_path not in self._connections:
|
||||||
# We use check_same_thread=False because aiosqlite handles
|
# We use check_same_thread=False because aiosqlite handles
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -21,13 +20,13 @@ from slowapi import Limiter
|
|||||||
from slowapi.util import get_remote_address
|
from slowapi.util import get_remote_address
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from core.zyrox import zyrox
|
from core.hexahost import HexaHost
|
||||||
|
|
||||||
# Initialize rate limiter
|
# Initialize rate limiter
|
||||||
limiter = Limiter(key_func=get_remote_address, default_limits=["1000 per minute"])
|
limiter = Limiter(key_func=get_remote_address, default_limits=["1000 per minute"])
|
||||||
|
|
||||||
# Global reference to the bot instance
|
# Global reference to the bot instance
|
||||||
_bot_instance: Optional["zyrox"] = None
|
_bot_instance: Optional["HexaHost"] = None
|
||||||
|
|
||||||
# Security scheme
|
# Security scheme
|
||||||
security = HTTPBearer()
|
security = HTTPBearer()
|
||||||
@@ -54,18 +53,18 @@ def verify_api_key(credentials: HTTPAuthorizationCredentials = Security(security
|
|||||||
)
|
)
|
||||||
return credentials.credentials
|
return credentials.credentials
|
||||||
|
|
||||||
def set_bot(bot_instance: "zyrox"):
|
def set_bot(bot_instance: "HexaHost"):
|
||||||
"""
|
"""
|
||||||
Sets the global bot instance.
|
Sets the global bot instance.
|
||||||
This should be called in CodeX.py during startup.
|
This should be called in HexaHost.py during startup.
|
||||||
"""
|
"""
|
||||||
global _bot_instance
|
global _bot_instance
|
||||||
_bot_instance = bot_instance
|
_bot_instance = bot_instance
|
||||||
|
|
||||||
def get_bot() -> "zyrox":
|
def get_bot() -> "HexaHost":
|
||||||
"""
|
"""
|
||||||
FastAPI dependency to retrieve the Discord bot instance.
|
FastAPI dependency to retrieve the Discord bot instance.
|
||||||
Usage: bot: zyrox = Depends(get_bot)
|
Usage: bot: HexaHost = Depends(get_bot)
|
||||||
"""
|
"""
|
||||||
if _bot_instance is None:
|
if _bot_instance is None:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ Discord OAuth permission checks for dashboard API requests ║
|
# ║ ║
|
||||||
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
|
# ║ ║
|
||||||
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
|
# ║ ║
|
||||||
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
from api.dependencies import get_bot
|
from api.dependencies import get_bot
|
||||||
@@ -20,11 +20,11 @@ import os
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from core.zyrox import zyrox
|
from core.hexahost import HexaHost
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
CONFIG_DB = "db/admin_config.db"
|
CONFIG_DB = db_path("admin_config.db")
|
||||||
|
|
||||||
async def init_db():
|
async def init_db():
|
||||||
async with aiosqlite.connect(CONFIG_DB) as db:
|
async with aiosqlite.connect(CONFIG_DB) as db:
|
||||||
@@ -38,7 +38,7 @@ import psutil
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
@router.get("/stats", response_model=AdminStats)
|
@router.get("/stats", response_model=AdminStats)
|
||||||
async def get_admin_stats(bot: "zyrox" = Depends(get_bot)):
|
async def get_admin_stats(bot: "HexaHost" = Depends(get_bot)):
|
||||||
# Calculate DB size and shard info
|
# Calculate DB size and shard info
|
||||||
total_size: float = 0.0
|
total_size: float = 0.0
|
||||||
db_count = 0
|
db_count = 0
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -20,12 +19,12 @@ from utils.config import *
|
|||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from core.zyrox import zyrox
|
from core.hexahost import HexaHost
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.get("/status", response_model=BotStatus, summary="Get bot status", description="Returns real-time health metrics, latency, and scale information.")
|
@router.get("/status", response_model=BotStatus, summary="Get bot status", description="Returns real-time health metrics, latency, and scale information.")
|
||||||
async def get_status(bot: "zyrox" = Depends(get_bot)):
|
async def get_status(bot: "HexaHost" = Depends(get_bot)):
|
||||||
"""
|
"""
|
||||||
Returns the live status of the bot.
|
Returns the live status of the bot.
|
||||||
"""
|
"""
|
||||||
@@ -39,7 +38,7 @@ async def get_status(bot: "zyrox" = Depends(get_bot)):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@router.get("/info", response_model=BotInfo, summary="Get bot info", description="Returns general information about the bot including command count and user reach.")
|
@router.get("/info", response_model=BotInfo, summary="Get bot info", description="Returns general information about the bot including command count and user reach.")
|
||||||
async def get_bot_info(bot: "zyrox" = Depends(get_bot)):
|
async def get_bot_info(bot: "HexaHost" = Depends(get_bot)):
|
||||||
"""
|
"""
|
||||||
Get general information about the Discord bot.
|
Get general information about the Discord bot.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path, jsondb_path
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Request
|
from fastapi import APIRouter, Depends, HTTPException, Request
|
||||||
from api.dependencies import get_bot, limiter
|
from api.dependencies import get_bot, limiter
|
||||||
@@ -37,13 +37,13 @@ import json
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from core.zyrox import zyrox
|
from core.hexahost import HexaHost
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|
||||||
@router.get("/", response_model=List[GuildSummary], summary="List all guilds", description="Returns guilds the authenticated user can manage that the bot is in.")
|
@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)):
|
async def list_guilds(request: Request, bot: "HexaHost" = Depends(get_bot)):
|
||||||
"""
|
"""
|
||||||
Lists guilds the bot is in, filtered to those the caller can manage on Discord.
|
Lists guilds the bot is in, filtered to those the caller can manage on Discord.
|
||||||
"""
|
"""
|
||||||
@@ -64,7 +64,7 @@ async def list_guilds(request: Request, bot: "zyrox" = Depends(get_bot)):
|
|||||||
return guilds_list
|
return guilds_list
|
||||||
|
|
||||||
@router.get("/{guild_id}", response_model=GuildDetails, summary="Get guild details", description="Returns detailed metrics and metadata for a specific Discord guild.")
|
@router.get("/{guild_id}", response_model=GuildDetails, summary="Get guild details", description="Returns detailed metrics and metadata for a specific Discord guild.")
|
||||||
async def get_guild_details(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
async def get_guild_details(guild_id: int, bot: "HexaHost" = Depends(get_bot)):
|
||||||
"""
|
"""
|
||||||
Returns detailed info for a specific guild by its ID.
|
Returns detailed info for a specific guild by its ID.
|
||||||
"""
|
"""
|
||||||
@@ -87,7 +87,7 @@ async def get_guild_prefix(guild_id: int):
|
|||||||
"""
|
"""
|
||||||
Retrieves the custom prefix for a specific guild.
|
Retrieves the custom prefix for a specific guild.
|
||||||
"""
|
"""
|
||||||
db = await db_manager.get_connection('db/prefix.db')
|
db = await db_manager.get_connection(db_path('prefix.db'))
|
||||||
cursor = await db.execute("SELECT prefix FROM prefixes WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT prefix FROM prefixes WHERE guild_id = ?", (guild_id,))
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
prefix = row[0] if row else ">"
|
prefix = row[0] if row else ">"
|
||||||
@@ -101,7 +101,7 @@ async def update_guild_prefix(guild_id: int, data: PrefixUpdate):
|
|||||||
if not data.prefix or len(data.prefix) > 10:
|
if not data.prefix or len(data.prefix) > 10:
|
||||||
raise HTTPException(status_code=400, detail="Invalid prefix. Must be 1-10 characters.")
|
raise HTTPException(status_code=400, detail="Invalid prefix. Must be 1-10 characters.")
|
||||||
|
|
||||||
db = await db_manager.get_connection('db/prefix.db')
|
db = await db_manager.get_connection(db_path('prefix.db'))
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"INSERT OR REPLACE INTO prefixes (guild_id, prefix) VALUES (?, ?)",
|
"INSERT OR REPLACE INTO prefixes (guild_id, prefix) VALUES (?, ?)",
|
||||||
(guild_id, data.prefix)
|
(guild_id, data.prefix)
|
||||||
@@ -117,7 +117,7 @@ async def get_guild_automod(guild_id: int):
|
|||||||
"""
|
"""
|
||||||
Retrieves the AutoMod configuration for a specific guild.
|
Retrieves the AutoMod configuration for a specific guild.
|
||||||
"""
|
"""
|
||||||
db = await db_manager.get_connection('db/automod.db')
|
db = await db_manager.get_connection(db_path('automod.db'))
|
||||||
# Check enabled status
|
# Check enabled status
|
||||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
enabled_row = await cursor.fetchone()
|
enabled_row = await cursor.fetchone()
|
||||||
@@ -152,7 +152,7 @@ async def patch_guild_automod(guild_id: int, data: AutomodUpdate):
|
|||||||
"""
|
"""
|
||||||
Updates parts of the AutoMod configuration for a specific guild.
|
Updates parts of the AutoMod configuration for a specific guild.
|
||||||
"""
|
"""
|
||||||
db = await db_manager.get_connection('db/automod.db')
|
db = await db_manager.get_connection(db_path('automod.db'))
|
||||||
if data.enabled is not None:
|
if data.enabled is not None:
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"INSERT OR REPLACE INTO automod (guild_id, enabled) VALUES (?, ?)",
|
"INSERT OR REPLACE INTO automod (guild_id, enabled) VALUES (?, ?)",
|
||||||
@@ -197,7 +197,7 @@ async def get_guild_tickets(guild_id: int):
|
|||||||
"""
|
"""
|
||||||
Retrieves the ticket system configuration for a specific guild.
|
Retrieves the ticket system configuration for a specific guild.
|
||||||
"""
|
"""
|
||||||
db = await db_manager.get_connection('db/ticket.db')
|
db = await db_manager.get_connection(db_path('ticket.db'))
|
||||||
|
|
||||||
# Get basic config
|
# Get basic config
|
||||||
cursor = await db.execute(
|
cursor = await db.execute(
|
||||||
@@ -263,7 +263,7 @@ async def patch_guild_tickets(guild_id: int, data: TicketUpdate):
|
|||||||
"""
|
"""
|
||||||
Updates the ticket system configuration for a specific guild.
|
Updates the ticket system configuration for a specific guild.
|
||||||
"""
|
"""
|
||||||
db = await db_manager.get_connection('db/ticket.db')
|
db = await db_manager.get_connection(db_path('ticket.db'))
|
||||||
|
|
||||||
# Initialize config row if not exists
|
# Initialize config row if not exists
|
||||||
cursor = await db.execute("SELECT guild_id FROM guild_configs WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT guild_id FROM guild_configs WHERE guild_id = ?", (guild_id,))
|
||||||
@@ -322,7 +322,7 @@ async def get_guild_leveling(guild_id: int):
|
|||||||
"""
|
"""
|
||||||
Retrieves the leveling system configuration for a specific guild.
|
Retrieves the leveling system configuration for a specific guild.
|
||||||
"""
|
"""
|
||||||
db = await db_manager.get_connection('db/leveling.db')
|
db = await db_manager.get_connection(db_path('leveling.db'))
|
||||||
cursor = await db.execute("SELECT * FROM leveling_settings WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT * FROM leveling_settings WHERE guild_id = ?", (guild_id,))
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -357,7 +357,7 @@ async def patch_guild_leveling(guild_id: int, data: LevelingUpdate):
|
|||||||
"""
|
"""
|
||||||
Updates parts of the leveling configuration for a specific guild.
|
Updates parts of the leveling configuration for a specific guild.
|
||||||
"""
|
"""
|
||||||
db = await db_manager.get_connection('db/leveling.db')
|
db = await db_manager.get_connection(db_path('leveling.db'))
|
||||||
# We use a series of updates or a single dynamic update.
|
# We use a series of updates or a single dynamic update.
|
||||||
# For simplicity and robustness with INSERT OR REPLACE:
|
# For simplicity and robustness with INSERT OR REPLACE:
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ async def get_guild_welcome(guild_id: int):
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
import json
|
import json
|
||||||
|
|
||||||
async with aiosqlite.connect("db/welcome.db") as db:
|
async with aiosqlite.connect(db_path("welcome.db")) as db:
|
||||||
async with db.execute("SELECT welcome_type, welcome_message, channel_id, embed_data, auto_delete_duration FROM welcome WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT welcome_type, welcome_message, channel_id, embed_data, auto_delete_duration FROM welcome WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -432,7 +432,7 @@ async def patch_guild_welcome(guild_id: int, data: WelcomeUpdate):
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
import json
|
import json
|
||||||
|
|
||||||
async with aiosqlite.connect("db/welcome.db") as db:
|
async with aiosqlite.connect(db_path("welcome.db")) as db:
|
||||||
# Get existing or create
|
# Get existing or create
|
||||||
async with db.execute("SELECT welcome_type, welcome_message, channel_id, embed_data, auto_delete_duration FROM welcome WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT welcome_type, welcome_message, channel_id, embed_data, auto_delete_duration FROM welcome WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
@@ -468,7 +468,7 @@ async def patch_guild_welcome(guild_id: int, data: WelcomeUpdate):
|
|||||||
async def get_guild_antinuke(guild_id: int):
|
async def get_guild_antinuke(guild_id: int):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
async with aiosqlite.connect("db/anti.db") as db:
|
async with aiosqlite.connect(db_path("anti.db")) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -490,7 +490,7 @@ async def get_guild_antinuke(guild_id: int):
|
|||||||
async def patch_guild_antinuke(guild_id: int, data: AntiNukeUpdate):
|
async def patch_guild_antinuke(guild_id: int, data: AntiNukeUpdate):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
async with aiosqlite.connect("db/anti.db") as db:
|
async with aiosqlite.connect(db_path("anti.db")) as db:
|
||||||
if data.status is not None:
|
if data.status is not None:
|
||||||
# Get existing or create
|
# Get existing or create
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
@@ -538,7 +538,7 @@ async def patch_guild_antinuke(guild_id: int, data: AntiNukeUpdate):
|
|||||||
async def get_guild_verification(guild_id: int):
|
async def get_guild_verification(guild_id: int):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
async with aiosqlite.connect("db/verification.db") as db:
|
async with aiosqlite.connect(db_path("verification.db")) as db:
|
||||||
async with db.execute("SELECT verification_channel_id, verified_role_id, log_channel_id, verification_method, enabled FROM verification_config WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT verification_channel_id, verified_role_id, log_channel_id, verification_method, enabled FROM verification_config WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -564,7 +564,7 @@ async def get_guild_verification(guild_id: int):
|
|||||||
async def patch_guild_verification(guild_id: int, data: VerificationUpdate):
|
async def patch_guild_verification(guild_id: int, data: VerificationUpdate):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
async with aiosqlite.connect("db/verification.db") as db:
|
async with aiosqlite.connect(db_path("verification.db")) as db:
|
||||||
async with db.execute("SELECT * FROM verification_config WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT * FROM verification_config WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -589,7 +589,7 @@ async def get_guild_vanityroles(guild_id: int):
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
setups = []
|
setups = []
|
||||||
async with aiosqlite.connect("db/vanity.db") as db:
|
async with aiosqlite.connect(db_path("vanity.db")) as db:
|
||||||
async with db.execute("SELECT vanity, role_id, log_channel_id FROM vanity_roles WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT vanity, role_id, log_channel_id FROM vanity_roles WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
rows = await cursor.fetchall()
|
rows = await cursor.fetchall()
|
||||||
for row in rows:
|
for row in rows:
|
||||||
@@ -604,7 +604,7 @@ async def get_guild_vanityroles(guild_id: int):
|
|||||||
async def post_guild_vanityroles(guild_id: int, data: VanityRoleSetup):
|
async def post_guild_vanityroles(guild_id: int, data: VanityRoleSetup):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
async with aiosqlite.connect("db/vanity.db") as db:
|
async with aiosqlite.connect(db_path("vanity.db")) as db:
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"INSERT OR REPLACE INTO vanity_roles (guild_id, vanity, role_id, log_channel_id, current_status) VALUES (?, ?, ?, ?, NULL)",
|
"INSERT OR REPLACE INTO vanity_roles (guild_id, vanity, role_id, log_channel_id, current_status) VALUES (?, ?, ?, ?, NULL)",
|
||||||
(guild_id, data.vanity.lower(), data.role_id, data.log_channel_id)
|
(guild_id, data.vanity.lower(), data.role_id, data.log_channel_id)
|
||||||
@@ -617,7 +617,7 @@ async def post_guild_vanityroles(guild_id: int, data: VanityRoleSetup):
|
|||||||
async def delete_guild_vanityroles(guild_id: int, vanity: str):
|
async def delete_guild_vanityroles(guild_id: int, vanity: str):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
async with aiosqlite.connect("db/vanity.db") as db:
|
async with aiosqlite.connect(db_path("vanity.db")) as db:
|
||||||
await db.execute("DELETE FROM vanity_roles WHERE guild_id = ? AND vanity = ?", (guild_id, vanity.lower()))
|
await db.execute("DELETE FROM vanity_roles WHERE guild_id = ? AND vanity = ?", (guild_id, vanity.lower()))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
|
|
||||||
@@ -628,7 +628,7 @@ async def delete_guild_vanityroles(guild_id: int, vanity: str):
|
|||||||
async def get_guild_autorole(guild_id: int):
|
async def get_guild_autorole(guild_id: int):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
async with aiosqlite.connect("db/autorole.db") as db:
|
async with aiosqlite.connect(db_path("autorole.db")) as db:
|
||||||
# Ensure table exists
|
# Ensure table exists
|
||||||
await db.execute("""
|
await db.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS autorole (
|
CREATE TABLE IF NOT EXISTS autorole (
|
||||||
@@ -662,7 +662,7 @@ async def get_guild_autorole(guild_id: int):
|
|||||||
async def patch_guild_autorole(guild_id: int, data: AutoRoleUpdate):
|
async def patch_guild_autorole(guild_id: int, data: AutoRoleUpdate):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
async with aiosqlite.connect("db/autorole.db") as db:
|
async with aiosqlite.connect(db_path("autorole.db")) as db:
|
||||||
await db.execute("""
|
await db.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS autorole (
|
CREATE TABLE IF NOT EXISTS autorole (
|
||||||
guild_id INTEGER PRIMARY KEY,
|
guild_id INTEGER PRIMARY KEY,
|
||||||
@@ -701,7 +701,7 @@ async def get_guild_welcome(guild_id: int):
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
import json
|
import json
|
||||||
|
|
||||||
async with aiosqlite.connect("db/welcome.db") as db:
|
async with aiosqlite.connect(db_path("welcome.db")) as db:
|
||||||
async with db.execute("SELECT welcome_type, welcome_message, channel_id, embed_data, auto_delete_duration FROM welcome WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT welcome_type, welcome_message, channel_id, embed_data, auto_delete_duration FROM welcome WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -730,7 +730,7 @@ async def patch_guild_welcome(guild_id: int, data: WelcomeUpdate):
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
import json
|
import json
|
||||||
|
|
||||||
async with aiosqlite.connect("db/welcome.db") as db:
|
async with aiosqlite.connect(db_path("welcome.db")) as db:
|
||||||
async with db.execute("SELECT welcome_type, welcome_message, channel_id, embed_data, auto_delete_duration FROM welcome WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT welcome_type, welcome_message, channel_id, embed_data, auto_delete_duration FROM welcome WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -766,7 +766,7 @@ async def patch_guild_welcome(guild_id: int, data: WelcomeUpdate):
|
|||||||
@router.delete("/{guild_id}/welcome", summary="Delete Welcome config")
|
@router.delete("/{guild_id}/welcome", summary="Delete Welcome config")
|
||||||
async def delete_guild_welcome(guild_id: int):
|
async def delete_guild_welcome(guild_id: int):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
async with aiosqlite.connect("db/welcome.db") as db:
|
async with aiosqlite.connect(db_path("welcome.db")) as db:
|
||||||
await db.execute("DELETE FROM welcome WHERE guild_id = ?", (guild_id,))
|
await db.execute("DELETE FROM welcome WHERE guild_id = ?", (guild_id,))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
return {"status": "success"}
|
return {"status": "success"}
|
||||||
@@ -775,7 +775,7 @@ async def delete_guild_welcome(guild_id: int):
|
|||||||
@router.get("/{guild_id}/tracking", response_model=TrackingConfig, summary="Get Tracking config")
|
@router.get("/{guild_id}/tracking", response_model=TrackingConfig, summary="Get Tracking config")
|
||||||
async def get_guild_tracking(guild_id: int):
|
async def get_guild_tracking(guild_id: int):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
async with aiosqlite.connect("db/invite.db") as db:
|
async with aiosqlite.connect(db_path("invite.db")) as db:
|
||||||
async with db.execute("SELECT channel_id FROM logging WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT channel_id FROM logging WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
return TrackingConfig(guild_id=guild_id, channel_id=row[0] if row else None)
|
return TrackingConfig(guild_id=guild_id, channel_id=row[0] if row else None)
|
||||||
@@ -783,7 +783,7 @@ async def get_guild_tracking(guild_id: int):
|
|||||||
@router.patch("/{guild_id}/tracking", summary="Update Tracking config")
|
@router.patch("/{guild_id}/tracking", summary="Update Tracking config")
|
||||||
async def patch_guild_tracking(guild_id: int, data: TrackingUpdate):
|
async def patch_guild_tracking(guild_id: int, data: TrackingUpdate):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
async with aiosqlite.connect("db/invite.db") as db:
|
async with aiosqlite.connect(db_path("invite.db")) as db:
|
||||||
await db.execute("INSERT OR REPLACE INTO logging (guild_id, channel_id) VALUES (?, ?)", (guild_id, data.channel_id))
|
await db.execute("INSERT OR REPLACE INTO logging (guild_id, channel_id) VALUES (?, ?)", (guild_id, data.channel_id))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
return {"status": "success"}
|
return {"status": "success"}
|
||||||
@@ -820,7 +820,7 @@ async def get_guild_j2c(guild_id: int):
|
|||||||
return J2CConfig(guild_id=str(guild_id))
|
return J2CConfig(guild_id=str(guild_id))
|
||||||
|
|
||||||
@router.patch("/{guild_id}/j2c", summary="Update J2C config")
|
@router.patch("/{guild_id}/j2c", summary="Update J2C config")
|
||||||
async def patch_guild_j2c(guild_id: int, data: J2CUpdate, bot: "zyrox" = Depends(get_bot)):
|
async def patch_guild_j2c(guild_id: int, data: J2CUpdate, bot: "HexaHost" = Depends(get_bot)):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
def to_id(val):
|
def to_id(val):
|
||||||
@@ -903,7 +903,7 @@ async def patch_guild_j2c(guild_id: int, data: J2CUpdate, bot: "zyrox" = Depends
|
|||||||
|
|
||||||
@router.get("/{guild_id}/joindm", response_model=JoinDMConfig, summary="Get JoinDM config")
|
@router.get("/{guild_id}/joindm", response_model=JoinDMConfig, summary="Get JoinDM config")
|
||||||
async def get_guild_joindm(guild_id: int):
|
async def get_guild_joindm(guild_id: int):
|
||||||
config_file = 'jsondb/joindm_messages.json'
|
config_file = jsondb_path('joindm_messages.json')
|
||||||
os.makedirs('jsondb', exist_ok=True)
|
os.makedirs('jsondb', exist_ok=True)
|
||||||
|
|
||||||
if os.path.exists(config_file):
|
if os.path.exists(config_file):
|
||||||
@@ -925,7 +925,7 @@ async def get_guild_joindm(guild_id: int):
|
|||||||
|
|
||||||
@router.patch("/{guild_id}/joindm", summary="Update JoinDM config")
|
@router.patch("/{guild_id}/joindm", summary="Update JoinDM config")
|
||||||
async def patch_guild_joindm(guild_id: int, data: JoinDMUpdate):
|
async def patch_guild_joindm(guild_id: int, data: JoinDMUpdate):
|
||||||
config_file = 'jsondb/joindm_messages.json'
|
config_file = jsondb_path('joindm_messages.json')
|
||||||
os.makedirs('jsondb', exist_ok=True)
|
os.makedirs('jsondb', exist_ok=True)
|
||||||
|
|
||||||
messages = {}
|
messages = {}
|
||||||
@@ -950,7 +950,7 @@ async def patch_guild_joindm(guild_id: int, data: JoinDMUpdate):
|
|||||||
@router.get("/{guild_id}/customroles", response_model=CustomRoleConfig, summary="Get CustomRoles config")
|
@router.get("/{guild_id}/customroles", response_model=CustomRoleConfig, summary="Get CustomRoles config")
|
||||||
async def get_guild_customroles(guild_id: int):
|
async def get_guild_customroles(guild_id: int):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
async with aiosqlite.connect('db/customrole.db') as db:
|
async with aiosqlite.connect(db_path('customrole.db')) as db:
|
||||||
async with db.execute("SELECT staff, girl, vip, guest, frnd, reqrole FROM roles WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT staff, girl, vip, guest, frnd, reqrole FROM roles WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
if row:
|
if row:
|
||||||
@@ -975,7 +975,7 @@ async def patch_guild_customroles(guild_id: int, data: CustomRoleUpdate):
|
|||||||
try: return int(val)
|
try: return int(val)
|
||||||
except: return None
|
except: return None
|
||||||
|
|
||||||
async with aiosqlite.connect('db/customrole.db') as db:
|
async with aiosqlite.connect(db_path('customrole.db')) as db:
|
||||||
async with db.execute("SELECT * FROM roles WHERE guild_id = ?", (guild_id,)) as cursor:
|
async with db.execute("SELECT * FROM roles WHERE guild_id = ?", (guild_id,)) as cursor:
|
||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -1000,7 +1000,7 @@ async def patch_guild_customroles(guild_id: int, data: CustomRoleUpdate):
|
|||||||
return {"status": "success"}
|
return {"status": "success"}
|
||||||
|
|
||||||
@router.get("/{guild_id}/logging", response_model=LoggingConfig, summary="Get Logging config", description="Retrieves the event logging configuration and designated log channels.")
|
@router.get("/{guild_id}/logging", response_model=LoggingConfig, summary="Get Logging config", description="Retrieves the event logging configuration and designated log channels.")
|
||||||
async def get_guild_logging(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
async def get_guild_logging(guild_id: int, bot: "HexaHost" = Depends(get_bot)):
|
||||||
"""
|
"""
|
||||||
Retrieves the logging configuration for a specific guild.
|
Retrieves the logging configuration for a specific guild.
|
||||||
"""
|
"""
|
||||||
@@ -1013,7 +1013,7 @@ async def get_guild_logging(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
|||||||
# Try reading from file as fallback
|
# Try reading from file as fallback
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
config_file = "jsondb/logging_config.json"
|
config_file = jsondb_path("logging_config.json")
|
||||||
if os.path.exists(config_file):
|
if os.path.exists(config_file):
|
||||||
try:
|
try:
|
||||||
with open(config_file, "r") as f:
|
with open(config_file, "r") as f:
|
||||||
@@ -1044,7 +1044,7 @@ async def get_guild_logging(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@router.patch("/{guild_id}/logging", summary="Update Logging config", description="Updates which Discord events are logged and where they are posted.")
|
@router.patch("/{guild_id}/logging", summary="Update Logging config", description="Updates which Discord events are logged and where they are posted.")
|
||||||
async def patch_guild_logging(guild_id: int, data: LoggingUpdate, bot: "zyrox" = Depends(get_bot)):
|
async def patch_guild_logging(guild_id: int, data: LoggingUpdate, bot: "HexaHost" = Depends(get_bot)):
|
||||||
"""
|
"""
|
||||||
Updates the logging configuration for a specific guild.
|
Updates the logging configuration for a specific guild.
|
||||||
"""
|
"""
|
||||||
@@ -1076,8 +1076,8 @@ async def patch_guild_logging(guild_id: int, data: LoggingUpdate, bot: "zyrox" =
|
|||||||
return {"status": "success", "guild_id": guild_id}
|
return {"status": "success", "guild_id": guild_id}
|
||||||
|
|
||||||
@router.get("/{guild_id}/leveling/leaderboard", response_model=List[LeaderboardEntry], summary="Get leveling leaderboard", description="Returns top users by XP for a specific guild.")
|
@router.get("/{guild_id}/leveling/leaderboard", response_model=List[LeaderboardEntry], summary="Get leveling leaderboard", description="Returns top users by XP for a specific guild.")
|
||||||
async def get_leveling_leaderboard(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
async def get_leveling_leaderboard(guild_id: int, bot: "HexaHost" = Depends(get_bot)):
|
||||||
db = await db_manager.get_connection('db/leveling.db')
|
db = await db_manager.get_connection(db_path('leveling.db'))
|
||||||
cursor = await db.execute(
|
cursor = await db.execute(
|
||||||
"SELECT user_id, xp FROM user_xp WHERE guild_id = ? ORDER BY xp DESC LIMIT 100",
|
"SELECT user_id, xp FROM user_xp WHERE guild_id = ? ORDER BY xp DESC LIMIT 100",
|
||||||
(guild_id,)
|
(guild_id,)
|
||||||
@@ -1116,7 +1116,7 @@ async def get_leveling_leaderboard(guild_id: int, bot: "zyrox" = Depends(get_bot
|
|||||||
return leaderboard
|
return leaderboard
|
||||||
|
|
||||||
@router.get("/{guild_id}/channels", response_model=List[DiscordChannel], summary="Get guild channels", description="Returns a list of all channels for the specific guild.")
|
@router.get("/{guild_id}/channels", response_model=List[DiscordChannel], summary="Get guild channels", description="Returns a list of all channels for the specific guild.")
|
||||||
async def get_guild_channels(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
async def get_guild_channels(guild_id: int, bot: "HexaHost" = Depends(get_bot)):
|
||||||
guild = bot.get_guild(guild_id)
|
guild = bot.get_guild(guild_id)
|
||||||
if not guild:
|
if not guild:
|
||||||
raise HTTPException(status_code=404, detail="Guild not found")
|
raise HTTPException(status_code=404, detail="Guild not found")
|
||||||
@@ -1136,7 +1136,7 @@ async def get_guild_channels(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
|||||||
return channels
|
return channels
|
||||||
|
|
||||||
@router.get("/{guild_id}/roles", response_model=List[DiscordRole], summary="Get guild roles", description="Returns a list of roles for the specific guild.")
|
@router.get("/{guild_id}/roles", response_model=List[DiscordRole], summary="Get guild roles", description="Returns a list of roles for the specific guild.")
|
||||||
async def get_guild_roles(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
async def get_guild_roles(guild_id: int, bot: "HexaHost" = Depends(get_bot)):
|
||||||
guild = bot.get_guild(guild_id)
|
guild = bot.get_guild(guild_id)
|
||||||
if not guild:
|
if not guild:
|
||||||
raise HTTPException(status_code=404, detail="Guild not found")
|
raise HTTPException(status_code=404, detail="Guild not found")
|
||||||
@@ -1164,7 +1164,7 @@ async def get_guild_roles(guild_id: int, bot: "zyrox" = Depends(get_bot)):
|
|||||||
@router.get("/{guild_id}/autoreact", response_model=AutoReactConfig, summary="Get AutoReact config")
|
@router.get("/{guild_id}/autoreact", response_model=AutoReactConfig, summary="Get AutoReact config")
|
||||||
async def get_guild_autoreact(guild_id: int):
|
async def get_guild_autoreact(guild_id: int):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
async with aiosqlite.connect("db/autoreact.db") as db:
|
async with aiosqlite.connect(db_path("autoreact.db")) as db:
|
||||||
await db.execute("""
|
await db.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS autoreact (
|
CREATE TABLE IF NOT EXISTS autoreact (
|
||||||
guild_id INTEGER,
|
guild_id INTEGER,
|
||||||
@@ -1185,7 +1185,7 @@ async def get_guild_autoreact(guild_id: int):
|
|||||||
|
|
||||||
@router.get("/{guild_id}/invcrole", response_model=InvcConfig, summary="Get Invc Role config")
|
@router.get("/{guild_id}/invcrole", response_model=InvcConfig, summary="Get Invc Role config")
|
||||||
async def get_guild_invcrole(guild_id: int):
|
async def get_guild_invcrole(guild_id: int):
|
||||||
db = await db_manager.get_connection('db/invc.db')
|
db = await db_manager.get_connection(db_path('invc.db'))
|
||||||
# Use execute instead of with for shared connection
|
# Use execute instead of with for shared connection
|
||||||
await db.execute("""
|
await db.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS vcroles (
|
CREATE TABLE IF NOT EXISTS vcroles (
|
||||||
@@ -1209,7 +1209,7 @@ async def get_guild_invcrole(guild_id: int):
|
|||||||
|
|
||||||
@router.patch("/{guild_id}/invcrole", summary="Update Invc Role config")
|
@router.patch("/{guild_id}/invcrole", summary="Update Invc Role config")
|
||||||
async def patch_guild_invcrole(guild_id: int, data: InvcUpdate):
|
async def patch_guild_invcrole(guild_id: int, data: InvcUpdate):
|
||||||
db = await db_manager.get_connection('db/invc.db')
|
db = await db_manager.get_connection(db_path('invc.db'))
|
||||||
|
|
||||||
# Get existing row to merge
|
# Get existing row to merge
|
||||||
cursor = await db.execute("SELECT role_id, enabled FROM vcroles WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT role_id, enabled FROM vcroles WHERE guild_id = ?", (guild_id,))
|
||||||
@@ -1246,7 +1246,7 @@ async def patch_guild_invcrole(guild_id: int, data: InvcUpdate):
|
|||||||
@router.get("/{guild_id}/autoreact", response_model=AutoReactConfig, summary="Get AutoReact config")
|
@router.get("/{guild_id}/autoreact", response_model=AutoReactConfig, summary="Get AutoReact config")
|
||||||
async def get_guild_autoreact(guild_id: int):
|
async def get_guild_autoreact(guild_id: int):
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
async with aiosqlite.connect("db/autoreact.db") as db:
|
async with aiosqlite.connect(db_path("autoreact.db")) as db:
|
||||||
await db.execute("""
|
await db.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS autoreact (
|
CREATE TABLE IF NOT EXISTS autoreact (
|
||||||
guild_id INTEGER,
|
guild_id INTEGER,
|
||||||
@@ -1264,7 +1264,7 @@ async def get_guild_autoreact(guild_id: int):
|
|||||||
|
|
||||||
@router.patch("/{guild_id}/autoreact", summary="Update AutoReact config")
|
@router.patch("/{guild_id}/autoreact", summary="Update AutoReact config")
|
||||||
async def patch_guild_autoreact(guild_id: int, data: AutoReactUpdate):
|
async def patch_guild_autoreact(guild_id: int, data: AutoReactUpdate):
|
||||||
db = await db_manager.get_connection("db/autoreact.db")
|
db = await db_manager.get_connection(db_path("autoreact.db"))
|
||||||
await db.execute("""
|
await db.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS autoreact (
|
CREATE TABLE IF NOT EXISTS autoreact (
|
||||||
guild_id INTEGER,
|
guild_id INTEGER,
|
||||||
@@ -1287,7 +1287,7 @@ async def get_guild_invites(guild_id: int):
|
|||||||
table_name = f"invites_{guild_id}"
|
table_name = f"invites_{guild_id}"
|
||||||
data_list = []
|
data_list = []
|
||||||
|
|
||||||
db = await db_manager.get_connection("db/invite.db")
|
db = await db_manager.get_connection(db_path("invite.db"))
|
||||||
# Check if table exists
|
# Check if table exists
|
||||||
async with db.execute("SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,)) as cursor:
|
async with db.execute("SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,)) as cursor:
|
||||||
exists = await cursor.fetchone()
|
exists = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -53,8 +52,8 @@ async def lifespan(app: FastAPI):
|
|||||||
|
|
||||||
def create_app() -> FastAPI:
|
def create_app() -> FastAPI:
|
||||||
"""
|
"""
|
||||||
Initializes the FastAPI application for the CodeX Bot Dashboard.
|
Initializes the FastAPI application for the HexaHost Bot Dashboard.
|
||||||
The bot instance will be attached to app.state.bot in CodeX.py at runtime.
|
The bot instance will be attached to app.state.bot in HexaHost.py at runtime.
|
||||||
"""
|
"""
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title=f"{BRAND_NAME} Bot API",
|
title=f"{BRAND_NAME} Bot API",
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from core import zyrox
|
|
||||||
from colorama import Fore, Style, init
|
|
||||||
|
|
||||||
|
from colorama import Fore, Style
|
||||||
|
|
||||||
|
from core import HexaHost
|
||||||
|
from utils.config import BotName
|
||||||
|
|
||||||
from .commands.help import Help
|
from .commands.help import Help
|
||||||
from .commands.general import General
|
from .commands.general import General
|
||||||
@@ -25,7 +26,7 @@ from .commands.welcome import Welcomer
|
|||||||
from .commands.fun import Fun
|
from .commands.fun import Fun
|
||||||
from .commands.Games import Games
|
from .commands.Games import Games
|
||||||
from .commands.extra import Extra
|
from .commands.extra import Extra
|
||||||
from .commands.owner import Owner
|
from .commands.owner import Owner, Badges
|
||||||
from .commands.voice import Voice
|
from .commands.voice import Voice
|
||||||
from .commands.afk import afk
|
from .commands.afk import afk
|
||||||
from .commands.ignore import Ignore
|
from .commands.ignore import Ignore
|
||||||
@@ -39,8 +40,6 @@ from .commands.blacklist import Blacklist
|
|||||||
from .commands.block import Block
|
from .commands.block import Block
|
||||||
from .commands.nightmode import Nightmode
|
from .commands.nightmode import Nightmode
|
||||||
from .commands.tracking import Tracking
|
from .commands.tracking import Tracking
|
||||||
from .commands.owner import Badges
|
|
||||||
#from .commands.map import Map
|
|
||||||
from .commands.autoresponder import AutoResponder
|
from .commands.autoresponder import AutoResponder
|
||||||
from .commands.customrole import Customrole
|
from .commands.customrole import Customrole
|
||||||
from .commands.autorole import AutoRole
|
from .commands.autorole import AutoRole
|
||||||
@@ -83,9 +82,7 @@ from .commands.Birthday import Birthdays
|
|||||||
from .commands.nitro import Nitro
|
from .commands.nitro import Nitro
|
||||||
from .commands.image import ImageCommands
|
from .commands.image import ImageCommands
|
||||||
from .commands.youtube import Youtube
|
from .commands.youtube import Youtube
|
||||||
#____________ Events _____________
|
|
||||||
|
|
||||||
#from .events.autoblacklist import AutoBlacklist
|
|
||||||
from .events.Errors import Errors
|
from .events.Errors import Errors
|
||||||
from .events.on_guild import Guild
|
from .events.on_guild import Guild
|
||||||
from .events.autorole import Autorole2
|
from .events.autorole import Autorole2
|
||||||
@@ -94,43 +91,37 @@ from .events.greet2 import greet
|
|||||||
from .events.mention import Mention
|
from .events.mention import Mention
|
||||||
from .events.react import React
|
from .events.react import React
|
||||||
from .events.autoreact import AutoReactListener
|
from .events.autoreact import AutoReactListener
|
||||||
#from .events.topgg import TopGG
|
|
||||||
from .events.ai import AIResponses
|
from .events.ai import AIResponses
|
||||||
from .events.stickymessage import StickyMessageListener
|
from .events.stickymessage import StickyMessageListener
|
||||||
|
|
||||||
########-------HELP-------########
|
from .hexahost.antinuke import _antinuke
|
||||||
from .zyrox.antinuke import _antinuke
|
from .hexahost.extra import _extra
|
||||||
from .zyrox.extra import _extra
|
from .hexahost.general import _general
|
||||||
from .zyrox.general import _general
|
from .hexahost.automod import _automod
|
||||||
from .zyrox.automod import _automod
|
from .hexahost.moderation import _moderation
|
||||||
from .zyrox.moderation import _moderation
|
from .hexahost.music import _music
|
||||||
#from .zyrox.inviteTracker import _inviteTracker
|
from .hexahost.fun import _fun
|
||||||
from .zyrox.music import _music
|
from .hexahost.games import _games
|
||||||
from .zyrox.fun import _fun
|
from .hexahost.ignore import _ignore
|
||||||
from .zyrox.games import _games
|
from .hexahost.server import _server
|
||||||
from .zyrox.ignore import _ignore
|
from .hexahost.voice import _voice
|
||||||
from .zyrox.server import _server
|
from .hexahost.welcome import _welcome
|
||||||
from .zyrox.voice import _voice
|
from .hexahost.giveaway import _giveaway
|
||||||
from .zyrox.welcome import _welcome
|
from .hexahost.ticket import _ticket
|
||||||
from .zyrox.giveaway import _giveaway
|
from .hexahost.logging import _logging
|
||||||
from .zyrox.ticket import _ticket
|
from .hexahost.vanity import _vanity
|
||||||
#from .axon.vanityroles import Vanityroles69999
|
from .hexahost.inviteTracker import inviteTracker
|
||||||
from .zyrox.logging import _logging
|
from .hexahost.counting import _Counting
|
||||||
from .zyrox.vanity import _vanity
|
from .hexahost.j2c import _J2C
|
||||||
from .zyrox.inviteTracker import inviteTracker
|
from .hexahost.ai import _ai
|
||||||
from .zyrox.counting import _Counting
|
from .hexahost.booster import __boost
|
||||||
from .zyrox.j2c import _J2C
|
from .hexahost.leveling import _leveling
|
||||||
from .zyrox.ai import _ai
|
from .hexahost.sticky import _sticky
|
||||||
from .zyrox.booster import __boost
|
from .hexahost.verify import _verify
|
||||||
from .zyrox.leveling import _leveling
|
from .hexahost.encryption import _encrypt
|
||||||
from .zyrox.sticky import _sticky
|
from .hexahost.mc import _mc
|
||||||
from .zyrox.verify import _verify
|
from .hexahost.joindm import _joindm
|
||||||
from .zyrox.encryption import _encrypt
|
from .hexahost.birth import _birth
|
||||||
from .zyrox.mc import _mc
|
|
||||||
from .zyrox.joindm import _joindm
|
|
||||||
from .zyrox.birth import _birth
|
|
||||||
|
|
||||||
#########ANTINUKE#########
|
|
||||||
|
|
||||||
from .antinuke.anti_member_update import AntiMemberUpdate
|
from .antinuke.anti_member_update import AntiMemberUpdate
|
||||||
from .antinuke.antiban import AntiBan
|
from .antinuke.antiban import AntiBan
|
||||||
@@ -150,15 +141,6 @@ from .antinuke.antiwebhook import AntiWebhookUpdate
|
|||||||
from .antinuke.antiwebhookcr import AntiWebhookCreate
|
from .antinuke.antiwebhookcr import AntiWebhookCreate
|
||||||
from .antinuke.antiwebhookdl import AntiWebhookDelete
|
from .antinuke.antiwebhookdl import AntiWebhookDelete
|
||||||
|
|
||||||
#Extra Optional Events
|
|
||||||
|
|
||||||
#from .antinuke.antiemocr import AntiEmojiCreate
|
|
||||||
#from .antinuke.antiemodl import AntiEmojiDelete
|
|
||||||
#from .antinuke.antiemoup import AntiEmojiUpdate
|
|
||||||
#from .antinuke.antisticker import AntiSticker
|
|
||||||
#from .antinuke.antiunban import AntiUnban
|
|
||||||
|
|
||||||
############ AUTOMOD ############
|
|
||||||
from .automod.antispam import AntiSpam
|
from .automod.antispam import AntiSpam
|
||||||
from .automod.anticaps import AntiCaps
|
from .automod.anticaps import AntiCaps
|
||||||
from .automod.antilink import AntiLink
|
from .automod.antilink import AntiLink
|
||||||
@@ -166,7 +148,6 @@ from .automod.anti_invites import AntiInvite
|
|||||||
from .automod.anti_mass_mention import AntiMassMention
|
from .automod.anti_mass_mention import AntiMassMention
|
||||||
from .automod.anti_emoji_spam import AntiEmojiSpam
|
from .automod.anti_emoji_spam import AntiEmojiSpam
|
||||||
|
|
||||||
|
|
||||||
from .moderation.ban import Ban
|
from .moderation.ban import Ban
|
||||||
from .moderation.unban import Unban
|
from .moderation.unban import Unban
|
||||||
from .moderation.timeout import Mute
|
from .moderation.timeout import Mute
|
||||||
@@ -183,194 +164,36 @@ from .moderation.moderation import Moderation
|
|||||||
from .moderation.topcheck import TopCheck
|
from .moderation.topcheck import TopCheck
|
||||||
from .moderation.snipe import Snipe
|
from .moderation.snipe import Snipe
|
||||||
|
|
||||||
|
# Load order preserved from legacy manual registration.
|
||||||
from utils.config import BotName
|
COG_CLASSES: tuple[type, ...] = (
|
||||||
|
Help, General, Music, Automod, Welcomer, Fun, Tracking, Games, Extra,
|
||||||
async def setup(bot: zyrox):
|
Voice, Owner, Customrole, afk, Embed, Media, Ignore, Invcrole, Giveaway,
|
||||||
cogs_to_load = [
|
Steal, Booster, Timer, Blacklist, Block, Nightmode, Badges, Antinuke,
|
||||||
Help, General, Moderation, Automod, Welcomer, Fun, Games, Extra,
|
Whitelist, Unwhitelist, Extraowner, Slots, Blackjack, Stats, Emergency,
|
||||||
Voice, Owner, Customrole, afk, Embed, Media, Ignore, TicketCog, Logging,
|
Status, NoPrefix, FilterCog, Global, TicketCog, Logging, QR, VanityRoles,
|
||||||
Invcrole, Steal, Timer,
|
ReactionRoles, Messages, TranslateCog, FastGreet, Jail, JoinToCreate, AI,
|
||||||
Blacklist, Block, Nightmode, Badges, Antinuke, Whitelist,
|
StaffDMCog, Leveling, StickyMessage, Verification, Minecraft, encryption,
|
||||||
Unwhitelist, Extraowner, Blackjack, Slots, Guild, Errors, Autorole2, Autorole, greet, AutoResponder,
|
calculator, joindm, Birthdays, Nitro, ImageCommands, Youtube,
|
||||||
Mention, AutoRole, React, AntiMemberUpdate, AntiBan, AntiBotAdd,
|
_antinuke, _extra, _general, _automod, _moderation, _music, _fun, _games,
|
||||||
AntiChannelCreate, AntiChannelDelete, AntiChannelUpdate, AntiEveryone, AntiGuildUpdate,
|
_ignore, _server, _voice, _welcome, _giveaway, _ticket, _logging, _vanity,
|
||||||
AntiIntegration, AntiKick, AntiPrune, AntiRoleCreate, AntiRoleDelete,
|
inviteTracker, Counting, _Counting, _J2C, _ai, __boost, _leveling, _sticky,
|
||||||
AntiRoleUpdate, AntiWebhookUpdate, AntiWebhookCreate,
|
_verify, _encrypt, _mc, _joindm, _birth,
|
||||||
AntiWebhookDelete, AntiSpam, AntiCaps, AntiLink, AntiInvite, AntiMassMention, Stats, Status, NoPrefix, FilterCog, AutoReaction, AutoReactListener, Ban, Unban, Mute, Unmute, Lock, Unlock, Hide, Unhide, Kick, Warn, Role, Message, Moderation, TopCheck, Snipe, Global, QR, VanityRoles, ReactionRoles, Messages, TranslateCog, FastGreet, Jail, inviteTracker,Counting,AI
|
Guild, Errors, Autorole2, Autorole, greet, AutoResponder, Mention, AutoRole,
|
||||||
]
|
React, AutoReaction, AutoReactListener, NotifCommands, StickyMessageListener,
|
||||||
|
AIResponses,
|
||||||
|
AntiMemberUpdate, AntiBan, AntiBotAdd, AntiChannelCreate, AntiChannelDelete,
|
||||||
|
AntiChannelUpdate, AntiEveryone, AntiGuildUpdate, AntiIntegration, AntiKick,
|
||||||
|
AntiPrune, AntiRoleCreate, AntiRoleDelete, AntiRoleUpdate, AntiWebhookUpdate,
|
||||||
|
AntiWebhookCreate, AntiWebhookDelete,
|
||||||
|
AntiSpam, AntiCaps, AntiInvite, AntiLink, AntiMassMention, AntiEmojiSpam,
|
||||||
|
Ban, Unban, Mute, Unmute, Lock, Unlock, Hide, Unhide, Kick, Warn, Role,
|
||||||
|
Message, Moderation, TopCheck, Snipe,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
await bot.add_cog(Help(bot))
|
async def setup(bot: HexaHost) -> None:
|
||||||
await bot.add_cog(General(bot))
|
for cog_cls in COG_CLASSES:
|
||||||
await bot.add_cog(Music(bot))
|
await bot.add_cog(cog_cls(bot))
|
||||||
await bot.add_cog(Automod(bot))
|
print(Fore.RED + Style.BRIGHT + f"Loaded cog: {cog_cls.__name__}")
|
||||||
await bot.add_cog(Welcomer(bot))
|
|
||||||
await bot.add_cog(Fun(bot))
|
|
||||||
await bot.add_cog(Tracking(bot))
|
|
||||||
await bot.add_cog(Games(bot))
|
|
||||||
await bot.add_cog(Extra(bot))
|
|
||||||
await bot.add_cog(Voice(bot))
|
|
||||||
await bot.add_cog(Owner(bot))
|
|
||||||
await bot.add_cog(Customrole(bot))
|
|
||||||
await bot.add_cog(afk(bot))
|
|
||||||
await bot.add_cog(Embed(bot))
|
|
||||||
await bot.add_cog(Media(bot))
|
|
||||||
await bot.add_cog(Ignore(bot))
|
|
||||||
await bot.add_cog(Invcrole(bot))
|
|
||||||
await bot.add_cog(Giveaway(bot))
|
|
||||||
await bot.add_cog(Steal(bot))
|
|
||||||
await bot.add_cog(Booster(bot))
|
|
||||||
await bot.add_cog(Timer(bot))
|
|
||||||
await bot.add_cog(Blacklist(bot))
|
|
||||||
await bot.add_cog(Block(bot))
|
|
||||||
await bot.add_cog(Nightmode(bot))
|
|
||||||
await bot.add_cog(Badges(bot))
|
|
||||||
await bot.add_cog(Antinuke(bot))
|
|
||||||
await bot.add_cog(Whitelist(bot))
|
|
||||||
await bot.add_cog(Unwhitelist(bot))
|
|
||||||
await bot.add_cog(Extraowner(bot))
|
|
||||||
await bot.add_cog(Slots(bot))
|
|
||||||
await bot.add_cog(Blackjack(bot))
|
|
||||||
await bot.add_cog(Stats(bot))
|
|
||||||
await bot.add_cog(Emergency(bot))
|
|
||||||
await bot.add_cog(Status(bot))
|
|
||||||
await bot.add_cog(NoPrefix(bot))
|
|
||||||
await bot.add_cog(FilterCog(bot))
|
|
||||||
await bot.add_cog(Global(bot))
|
|
||||||
# await bot.add_cog(Map(bot))
|
|
||||||
await bot.add_cog(TicketCog(bot))
|
|
||||||
await bot.add_cog(Logging(bot))
|
|
||||||
await bot.add_cog(QR(bot))
|
|
||||||
await bot.add_cog(VanityRoles(bot))
|
|
||||||
await bot.add_cog(ReactionRoles(bot))
|
|
||||||
await bot.add_cog(Messages(bot))
|
|
||||||
await bot.add_cog(TranslateCog(bot))
|
|
||||||
await bot.add_cog(FastGreet(bot))
|
|
||||||
await bot.add_cog(Jail(bot))
|
|
||||||
await bot.add_cog(JoinToCreate(bot))
|
|
||||||
await bot.add_cog(AI(bot))
|
|
||||||
await bot.add_cog(StaffDMCog(bot))
|
|
||||||
await bot.add_cog(Leveling(bot))
|
|
||||||
await bot.add_cog(StickyMessage(bot))
|
|
||||||
await bot.add_cog(Verification(bot))
|
|
||||||
await bot.add_cog(Minecraft(bot))
|
|
||||||
await bot.add_cog(encryption(bot))
|
|
||||||
await bot.add_cog(calculator(bot))
|
|
||||||
await bot.add_cog(joindm(bot))
|
|
||||||
await bot.add_cog(Birthdays(bot))
|
|
||||||
await bot.add_cog(Nitro(bot))
|
|
||||||
await bot.add_cog(ImageCommands(bot))
|
|
||||||
await bot.add_cog(Youtube(bot))
|
|
||||||
|
|
||||||
await bot.add_cog(_antinuke(bot))
|
|
||||||
await bot.add_cog(_extra(bot))
|
|
||||||
await bot.add_cog(_general(bot))
|
|
||||||
await bot.add_cog(_automod(bot))
|
|
||||||
await bot.add_cog(_moderation(bot))
|
|
||||||
await bot.add_cog(_music(bot))
|
|
||||||
await bot.add_cog(_fun(bot))
|
|
||||||
await bot.add_cog(_games(bot))
|
|
||||||
await bot.add_cog(_ignore(bot))
|
|
||||||
await bot.add_cog(_server(bot))
|
|
||||||
await bot.add_cog(_voice(bot))
|
|
||||||
await bot.add_cog(_welcome(bot))
|
|
||||||
await bot.add_cog(_giveaway(bot))
|
|
||||||
await bot.add_cog(_ticket(bot))
|
|
||||||
await bot.add_cog(_logging(bot))
|
|
||||||
await bot.add_cog(_vanity(bot))
|
|
||||||
await bot.add_cog(inviteTracker(bot))
|
|
||||||
await bot.add_cog(Counting(bot))
|
|
||||||
await bot.add_cog(_Counting(bot))
|
|
||||||
await bot.add_cog(_J2C(bot))
|
|
||||||
await bot.add_cog(_ai(bot))
|
|
||||||
await bot.add_cog(__boost(bot))
|
|
||||||
await bot.add_cog(_leveling(bot))
|
|
||||||
await bot.add_cog(_sticky(bot))
|
|
||||||
await bot.add_cog(_verify(bot))
|
|
||||||
await bot.add_cog(_encrypt(bot))
|
|
||||||
await bot.add_cog(_mc(bot))
|
|
||||||
await bot.add_cog(_joindm(bot))
|
|
||||||
await bot.add_cog(_birth(bot))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#await bot.add_cog(AutoBlacklist(bot))
|
|
||||||
await bot.add_cog(Guild(bot))
|
|
||||||
await bot.add_cog(Errors(bot))
|
|
||||||
await bot.add_cog(Autorole2(bot))
|
|
||||||
await bot.add_cog(Autorole(bot))
|
|
||||||
await bot.add_cog(greet(bot))
|
|
||||||
await bot.add_cog(AutoResponder(bot))
|
|
||||||
await bot.add_cog(Mention(bot))
|
|
||||||
await bot.add_cog(AutoRole(bot))
|
|
||||||
await bot.add_cog(React(bot))
|
|
||||||
await bot.add_cog(AutoReaction(bot))
|
|
||||||
await bot.add_cog(AutoReactListener(bot))
|
|
||||||
await bot.add_cog(NotifCommands(bot))
|
|
||||||
await bot.add_cog(StickyMessageListener(bot))
|
|
||||||
await bot.add_cog(AIResponses(bot))
|
|
||||||
|
|
||||||
|
|
||||||
await bot.add_cog(AntiMemberUpdate(bot))
|
|
||||||
await bot.add_cog(AntiBan(bot))
|
|
||||||
await bot.add_cog(AntiBotAdd(bot))
|
|
||||||
await bot.add_cog(AntiChannelCreate(bot))
|
|
||||||
await bot.add_cog(AntiChannelDelete(bot))
|
|
||||||
await bot.add_cog(AntiChannelUpdate(bot))
|
|
||||||
await bot.add_cog(AntiEveryone(bot))
|
|
||||||
await bot.add_cog(AntiGuildUpdate(bot))
|
|
||||||
await bot.add_cog(AntiIntegration(bot))
|
|
||||||
await bot.add_cog(AntiKick(bot))
|
|
||||||
await bot.add_cog(AntiPrune(bot))
|
|
||||||
await bot.add_cog(AntiRoleCreate(bot))
|
|
||||||
await bot.add_cog(AntiRoleDelete(bot))
|
|
||||||
await bot.add_cog(AntiRoleUpdate(bot))
|
|
||||||
await bot.add_cog(AntiWebhookUpdate(bot))
|
|
||||||
await bot.add_cog(AntiWebhookCreate(bot))
|
|
||||||
await bot.add_cog(AntiWebhookDelete(bot))
|
|
||||||
|
|
||||||
|
|
||||||
#Extra Optional Events
|
|
||||||
|
|
||||||
#await bot.add_cog(AntiEmojiCreate(bot))
|
|
||||||
#await bot.add_cog(AntiEmojiDelete(bot))
|
|
||||||
#await bot.add_cog(AntiEmojiUpdate(bot))
|
|
||||||
#await bot.add_cog(AntiSticker(bot))
|
|
||||||
#await bot.add_cog(AntiUnban(bot))
|
|
||||||
|
|
||||||
|
|
||||||
await bot.add_cog(AntiSpam(bot))
|
|
||||||
await bot.add_cog(AntiCaps(bot))
|
|
||||||
await bot.add_cog(AntiInvite(bot))
|
|
||||||
await bot.add_cog(AntiLink(bot))
|
|
||||||
await bot.add_cog(AntiMassMention(bot))
|
|
||||||
await bot.add_cog(AntiEmojiSpam(bot))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await bot.add_cog(Ban(bot))
|
|
||||||
await bot.add_cog(Unban(bot))
|
|
||||||
await bot.add_cog(Mute(bot))
|
|
||||||
await bot.add_cog(Unmute(bot))
|
|
||||||
await bot.add_cog(Lock(bot))
|
|
||||||
await bot.add_cog(Unlock(bot))
|
|
||||||
await bot.add_cog(Hide(bot))
|
|
||||||
await bot.add_cog(Unhide(bot))
|
|
||||||
await bot.add_cog(Kick(bot))
|
|
||||||
await bot.add_cog(Warn(bot))
|
|
||||||
await bot.add_cog(Role(bot))
|
|
||||||
await bot.add_cog(Message(bot))
|
|
||||||
await bot.add_cog(Moderation(bot))
|
|
||||||
await bot.add_cog(TopCheck(bot))
|
|
||||||
await bot.add_cog(Snipe(bot))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for cog in cogs_to_load:
|
|
||||||
print(Fore.RED + Style.BRIGHT + f"Loaded cog: {cog.__name__}")
|
|
||||||
print(Fore.RED + Style.BRIGHT + f"All {BotName} Cogs loaded successfully.")
|
print(Fore.RED + Style.BRIGHT + f"All {BotName} Cogs loaded successfully.")
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -61,7 +61,7 @@ class AntiIntegration(commands.Cog):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class AntiIntegration(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ class AntiIntegration(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
extraowner_status = await cursor.fetchone()
|
extraowner_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -26,7 +26,7 @@ class AntiMemberUpdate(commands.Cog):
|
|||||||
self.cooldowns = {}
|
self.cooldowns = {}
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class AntiMemberUpdate(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
@@ -88,7 +88,7 @@ class AntiMemberUpdate(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
extra_owner_status = await cursor.fetchone()
|
extra_owner_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -59,7 +59,7 @@ class AntiBan(commands.Cog):
|
|||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_member_ban(self, guild, user):
|
async def on_member_ban(self, guild, user):
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -63,7 +63,7 @@ class AntiBotAdd(commands.Cog):
|
|||||||
return
|
return
|
||||||
|
|
||||||
guild = member.guild
|
guild = member.guild
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -89,7 +89,7 @@ class AntiChannelCreate(commands.Cog):
|
|||||||
async def on_guild_channel_create(self, channel):
|
async def on_guild_channel_create(self, channel):
|
||||||
guild = channel.guild
|
guild = channel.guild
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -60,7 +60,7 @@ class AntiChannelDelete(commands.Cog):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_guild_channel_delete(self, channel):
|
async def on_guild_channel_delete(self, channel):
|
||||||
guild = channel.guild
|
guild = channel.guild
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -60,7 +60,7 @@ class AntiChannelUpdate(commands.Cog):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_guild_channel_update(self, before, after):
|
async def on_guild_channel_update(self, before, after):
|
||||||
guild = before.guild
|
guild = before.guild
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -44,7 +44,7 @@ class AntiEveryone(commands.Cog):
|
|||||||
|
|
||||||
guild = message.guild
|
guild = message.guild
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -61,7 +61,7 @@ class AntiGuildUpdate(commands.Cog):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class AntiGuildUpdate(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ class AntiGuildUpdate(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT serverup FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
async with db.execute("SELECT serverup FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
whitelist_status = await cursor.fetchone()
|
whitelist_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -26,7 +26,7 @@ class AntiKick(commands.Cog):
|
|||||||
self.cooldowns = {}
|
self.cooldowns = {}
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class AntiKick(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(member.guild.id):
|
if await self.is_blacklisted_guild(member.guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (member.guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (member.guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
@@ -87,7 +87,7 @@ class AntiKick(commands.Cog):
|
|||||||
if executor.id in {member.guild.owner_id, self.bot.user.id}:
|
if executor.id in {member.guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
||||||
(member.guild.id, executor.id)) as cursor:
|
(member.guild.id, executor.id)) as cursor:
|
||||||
extraowner_status = await cursor.fetchone()
|
extraowner_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -42,7 +42,7 @@ class AntiPrune(commands.Cog):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_member_remove(self, member):
|
async def on_member_remove(self, member):
|
||||||
guild = member.guild
|
guild = member.guild
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -26,7 +26,7 @@ class AntiRoleCreate(commands.Cog):
|
|||||||
self.cooldowns = {}
|
self.cooldowns = {}
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class AntiRoleCreate(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
@@ -89,7 +89,7 @@ class AntiRoleCreate(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
extra_owner_status = await cursor.fetchone()
|
extra_owner_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -26,7 +26,7 @@ class AntiRoleDelete(commands.Cog):
|
|||||||
self.cooldowns = {}
|
self.cooldowns = {}
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class AntiRoleDelete(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
@@ -89,7 +89,7 @@ class AntiRoleDelete(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
async with db.execute("SELECT owner_id FROM extraowners WHERE guild_id = ? AND owner_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
extra_owner_status = await cursor.fetchone()
|
extra_owner_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -26,7 +26,7 @@ class AntiRoleUpdate(commands.Cog):
|
|||||||
self.cooldowns = {}
|
self.cooldowns = {}
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class AntiRoleUpdate(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
if not antinuke_status or not antinuke_status[0]:
|
if not antinuke_status or not antinuke_status[0]:
|
||||||
@@ -89,7 +89,7 @@ class AntiRoleUpdate(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT rlup FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
async with db.execute("SELECT rlup FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
whitelist_status = await cursor.fetchone()
|
whitelist_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -58,7 +58,7 @@ class AntiWebhookUpdate(commands.Cog):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ class AntiWebhookUpdate(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class AntiWebhookUpdate(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT mngweb FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
async with db.execute("SELECT mngweb FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
whitelist_status = await cursor.fetchone()
|
whitelist_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -58,7 +58,7 @@ class AntiWebhookCreate(commands.Cog):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ class AntiWebhookCreate(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class AntiWebhookCreate(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT mngweb FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
async with db.execute("SELECT mngweb FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
whitelist_status = await cursor.fetchone()
|
whitelist_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -58,7 +58,7 @@ class AntiWebhookDelete(commands.Cog):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
async def is_blacklisted_guild(self, guild_id):
|
async def is_blacklisted_guild(self, guild_id):
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
cursor = await block_db.execute("SELECT 1 FROM guild_blacklist WHERE guild_id = ?", (str(guild_id),))
|
||||||
return await cursor.fetchone() is not None
|
return await cursor.fetchone() is not None
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ class AntiWebhookDelete(commands.Cog):
|
|||||||
if await self.is_blacklisted_guild(guild.id):
|
if await self.is_blacklisted_guild(guild.id):
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class AntiWebhookDelete(commands.Cog):
|
|||||||
if executor.id in {guild.owner_id, self.bot.user.id}:
|
if executor.id in {guild.owner_id, self.bot.user.id}:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT mngweb FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
async with db.execute("SELECT mngweb FROM whitelisted_users WHERE guild_id = ? AND user_id = ?",
|
||||||
(guild.id, executor.id)) as cursor:
|
(guild.id, executor.id)) as cursor:
|
||||||
whitelist_status = await cursor.fetchone()
|
whitelist_status = await cursor.fetchone()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from utils.db_paths import db_path
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
@@ -29,7 +30,7 @@ class AntiEmojiCreate(commands.Cog):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_guild_emojis_update(self, guild, before, after):
|
async def on_guild_emojis_update(self, guild, before, after):
|
||||||
if len(after) > len(before):
|
if len(after) > len(before):
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from utils.db_paths import db_path
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
@@ -29,7 +30,7 @@ class AntiEmojiDelete(commands.Cog):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_guild_emojis_update(self, guild, before, after):
|
async def on_guild_emojis_update(self, guild, before, after):
|
||||||
if len(after) < len(before):
|
if len(after) < len(before):
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from utils.db_paths import db_path
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
@@ -29,7 +30,7 @@ class AntiEmojiUpdate(commands.Cog):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_guild_emojis_update(self, guild, before, after):
|
async def on_guild_emojis_update(self, guild, before, after):
|
||||||
if len(after) == len(before): # An emoji was updated
|
if len(after) == len(before): # An emoji was updated
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from utils.db_paths import db_path
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from datetime import timedelta, datetime
|
from datetime import timedelta, datetime
|
||||||
@@ -34,7 +35,7 @@ class AntiSticker(commands.Cog):
|
|||||||
else:
|
else:
|
||||||
action = discord.AuditLogAction.sticker_update
|
action = discord.AuditLogAction.sticker_update
|
||||||
|
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from utils.db_paths import db_path
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
@@ -26,7 +27,7 @@ class AntiUnban(commands.Cog):
|
|||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_member_unban(self, guild, user):
|
async def on_member_unban(self, guild, user):
|
||||||
async with aiosqlite.connect('db/anti.db') as db:
|
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||||
antinuke_status = await cursor.fetchone()
|
antinuke_status = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import TICK
|
from utils.emoji import TICK
|
||||||
@@ -26,35 +26,35 @@ class AntiEmojiSpam(commands.Cog):
|
|||||||
self.emoji_threshold = 5
|
self.emoji_threshold = 5
|
||||||
|
|
||||||
async def is_automod_enabled(self, guild_id):
|
async def is_automod_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None and result[0] == 1
|
return result is not None and result[0] == 1
|
||||||
|
|
||||||
async def is_anti_emoji_spam_enabled(self, guild_id):
|
async def is_anti_emoji_spam_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti emoji spam'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti emoji spam'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None
|
return result is not None
|
||||||
|
|
||||||
async def get_ignored_channels(self, guild_id):
|
async def get_ignored_channels(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_ignored_roles(self, guild_id):
|
async def get_ignored_roles(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_punishment(self, guild_id):
|
async def get_punishment(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti emoji spam'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti emoji spam'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result[0] if result else None
|
return result[0] if result else None
|
||||||
|
|
||||||
async def log_action(self, guild, user, channel, action, reason):
|
async def log_action(self, guild, user, channel, action, reason):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
||||||
log_channel_id = await cursor.fetchone()
|
log_channel_id = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import TICK
|
from utils.emoji import TICK
|
||||||
@@ -26,35 +26,35 @@ class AntiInvite(commands.Cog):
|
|||||||
self.invite_pattern = re.compile(r'(https?://)?(www\.)?(discord\.gg|discordapp\.com/invite|discord\.com/invite)/\S+')
|
self.invite_pattern = re.compile(r'(https?://)?(www\.)?(discord\.gg|discordapp\.com/invite|discord\.com/invite)/\S+')
|
||||||
|
|
||||||
async def is_automod_enabled(self, guild_id):
|
async def is_automod_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None and result[0] == 1
|
return result is not None and result[0] == 1
|
||||||
|
|
||||||
async def is_anti_invites_enabled(self, guild_id):
|
async def is_anti_invites_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti invites'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti invites'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None
|
return result is not None
|
||||||
|
|
||||||
async def get_ignored_channels(self, guild_id):
|
async def get_ignored_channels(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_ignored_roles(self, guild_id):
|
async def get_ignored_roles(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_punishment(self, guild_id):
|
async def get_punishment(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti invites'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti invites'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result[0] if result else None
|
return result[0] if result else None
|
||||||
|
|
||||||
async def log_action(self, guild, user, channel, action, reason):
|
async def log_action(self, guild, user, channel, action, reason):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
||||||
log_channel_id = await cursor.fetchone()
|
log_channel_id = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import TICK
|
from utils.emoji import TICK
|
||||||
@@ -25,36 +25,36 @@ class AntiMassMention(commands.Cog):
|
|||||||
self.mass_mention_threshold = 5
|
self.mass_mention_threshold = 5
|
||||||
|
|
||||||
async def is_automod_enabled(self, guild_id):
|
async def is_automod_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None and result[0] == 1
|
return result is not None and result[0] == 1
|
||||||
|
|
||||||
async def is_anti_mass_mention_enabled(self, guild_id):
|
async def is_anti_mass_mention_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti mass mention'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti mass mention'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None
|
return result is not None
|
||||||
|
|
||||||
async def get_ignored_channels(self, guild_id):
|
async def get_ignored_channels(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_ignored_roles(self, guild_id):
|
async def get_ignored_roles(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_punishment(self, guild_id):
|
async def get_punishment(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti mass mention'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti mass mention'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result[0] if result else None
|
return result[0] if result else None
|
||||||
|
|
||||||
|
|
||||||
async def log_action(self, guild, user, channel, action, reason):
|
async def log_action(self, guild, user, channel, action, reason):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
||||||
log_channel_id = await cursor.fetchone()
|
log_channel_id = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import TICK
|
from utils.emoji import TICK
|
||||||
@@ -26,35 +26,35 @@ class AntiCaps(commands.Cog):
|
|||||||
self.mute_duration = 2 * 60
|
self.mute_duration = 2 * 60
|
||||||
|
|
||||||
async def is_automod_enabled(self, guild_id):
|
async def is_automod_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None and result[0] == 1
|
return result is not None and result[0] == 1
|
||||||
|
|
||||||
async def is_anti_caps_enabled(self, guild_id):
|
async def is_anti_caps_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti caps'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti caps'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None
|
return result is not None
|
||||||
|
|
||||||
async def get_ignored_channels(self, guild_id):
|
async def get_ignored_channels(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_ignored_roles(self, guild_id):
|
async def get_ignored_roles(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_punishment(self, guild_id):
|
async def get_punishment(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti caps'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti caps'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result[0] if result else None
|
return result[0] if result else None
|
||||||
|
|
||||||
async def log_action(self, guild, user, channel, action, reason):
|
async def log_action(self, guild, user, channel, action, reason):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
||||||
log_channel_id = await cursor.fetchone()
|
log_channel_id = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import TICK
|
from utils.emoji import TICK
|
||||||
@@ -29,35 +29,35 @@ class AntiLink(commands.Cog):
|
|||||||
self.spotify_pattern = re.compile(r'^https://open\.spotify\.com/track/\S+')
|
self.spotify_pattern = re.compile(r'^https://open\.spotify\.com/track/\S+')
|
||||||
|
|
||||||
async def is_automod_enabled(self, guild_id):
|
async def is_automod_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None and result[0] == 1
|
return result is not None and result[0] == 1
|
||||||
|
|
||||||
async def is_anti_link_enabled(self, guild_id):
|
async def is_anti_link_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti link'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti link'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None
|
return result is not None
|
||||||
|
|
||||||
async def get_ignored_channels(self, guild_id):
|
async def get_ignored_channels(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_ignored_roles(self, guild_id):
|
async def get_ignored_roles(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_punishment(self, guild_id):
|
async def get_punishment(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti link'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti link'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result[0] if result else None
|
return result[0] if result else None
|
||||||
|
|
||||||
async def log_action(self, guild, user, channel, action, reason):
|
async def log_action(self, guild, user, channel, action, reason):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
||||||
log_channel_id = await cursor.fetchone()
|
log_channel_id = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import TICK
|
from utils.emoji import TICK
|
||||||
@@ -27,36 +27,36 @@ class AntiSpam(commands.Cog):
|
|||||||
self.recent_messages = {}
|
self.recent_messages = {}
|
||||||
|
|
||||||
async def is_automod_enabled(self, guild_id):
|
async def is_automod_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None and result[0] == 1
|
return result is not None and result[0] == 1
|
||||||
|
|
||||||
async def is_anti_spam_enabled(self, guild_id):
|
async def is_anti_spam_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti spam'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti spam'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None
|
return result is not None
|
||||||
|
|
||||||
|
|
||||||
async def get_ignored_channels(self, guild_id):
|
async def get_ignored_channels(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_ignored_roles(self, guild_id):
|
async def get_ignored_roles(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
||||||
return [row[0] for row in await cursor.fetchall()]
|
return [row[0] for row in await cursor.fetchall()]
|
||||||
|
|
||||||
async def get_punishment(self, guild_id):
|
async def get_punishment(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti spam'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti spam'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result[0] if result else None
|
return result[0] if result else None
|
||||||
|
|
||||||
async def log_action(self, guild, user, channel, action, reason):
|
async def log_action(self, guild, user, channel, action, reason):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
||||||
log_channel_id = await cursor.fetchone()
|
log_channel_id = await cursor.fetchone()
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import jsondb_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
@@ -56,7 +56,7 @@ class Birthdays(commands.Cog):
|
|||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def birthday_setup(self, ctx: commands.Context, channel: discord.TextChannel, role: discord.Role):
|
async def birthday_setup(self, ctx: commands.Context, channel: discord.TextChannel, role: discord.Role):
|
||||||
db = read_db('jsondb/birthday_logs.json')
|
db = read_db(jsondb_path('birthday_logs.json'))
|
||||||
guild_id = str(ctx.guild.id)
|
guild_id = str(ctx.guild.id)
|
||||||
|
|
||||||
if guild_id not in db:
|
if guild_id not in db:
|
||||||
@@ -65,7 +65,7 @@ class Birthdays(commands.Cog):
|
|||||||
db[guild_id]["birthday_channel_id"] = channel.id
|
db[guild_id]["birthday_channel_id"] = channel.id
|
||||||
db[guild_id]["birthday_role_id"] = role.id
|
db[guild_id]["birthday_role_id"] = role.id
|
||||||
|
|
||||||
write_db('jsondb/birthday_logs.json', db)
|
write_db(jsondb_path('birthday_logs.json'), db)
|
||||||
|
|
||||||
await ctx.send(view=CV2("Birthday Setup", f"Birthday log channel set to {channel.mention} and birthday role set to {role.mention}."))
|
await ctx.send(view=CV2("Birthday Setup", f"Birthday log channel set to {channel.mention} and birthday role set to {role.mention}."))
|
||||||
|
|
||||||
@@ -104,9 +104,9 @@ class Birthdays(commands.Cog):
|
|||||||
return
|
return
|
||||||
|
|
||||||
date = f"{month}-{day}-{year}"
|
date = f"{month}-{day}-{year}"
|
||||||
db = read_db('jsondb/birthdays.json')
|
db = read_db(jsondb_path('birthdays.json'))
|
||||||
db[str(ctx.author.id)] = date
|
db[str(ctx.author.id)] = date
|
||||||
write_db('jsondb/birthdays.json', db)
|
write_db(jsondb_path('birthdays.json'), db)
|
||||||
|
|
||||||
await ctx.send(view=CV2("Success", f"Your birthday has been set to {date}."))
|
await ctx.send(view=CV2("Success", f"Your birthday has been set to {date}."))
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
@@ -117,11 +117,11 @@ class Birthdays(commands.Cog):
|
|||||||
help="Remove your birthday.")
|
help="Remove your birthday.")
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def remove_birthday(self, ctx: commands.Context):
|
async def remove_birthday(self, ctx: commands.Context):
|
||||||
db = read_db('jsondb/birthdays.json')
|
db = read_db(jsondb_path('birthdays.json'))
|
||||||
|
|
||||||
if str(ctx.author.id) in db:
|
if str(ctx.author.id) in db:
|
||||||
del db[str(ctx.author.id)]
|
del db[str(ctx.author.id)]
|
||||||
write_db('jsondb/birthdays.json', db)
|
write_db(jsondb_path('birthdays.json'), db)
|
||||||
await ctx.send(view=CV2("Success", "Your birthday has been removed."))
|
await ctx.send(view=CV2("Success", "Your birthday has been removed."))
|
||||||
else:
|
else:
|
||||||
await ctx.send(view=CV2("Error", "You have no birthday set."))
|
await ctx.send(view=CV2("Error", "You have no birthday set."))
|
||||||
@@ -133,7 +133,7 @@ class Birthdays(commands.Cog):
|
|||||||
async def list_birthdays(self, ctx: commands.Context):
|
async def list_birthdays(self, ctx: commands.Context):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
today_date = now.strftime("%m-%d")
|
today_date = now.strftime("%m-%d")
|
||||||
db = read_db('jsondb/birthdays.json')
|
db = read_db(jsondb_path('birthdays.json'))
|
||||||
|
|
||||||
members_with_birthday = [ctx.guild.get_member(int(user_id)) for user_id, date in db.items() if date.startswith(today_date)]
|
members_with_birthday = [ctx.guild.get_member(int(user_id)) for user_id, date in db.items() if date.startswith(today_date)]
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ class Birthdays(commands.Cog):
|
|||||||
help="Check your birthday.")
|
help="Check your birthday.")
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def check_birthday(self, ctx: commands.Context):
|
async def check_birthday(self, ctx: commands.Context):
|
||||||
db = read_db('jsondb/birthdays.json')
|
db = read_db(jsondb_path('birthdays.json'))
|
||||||
|
|
||||||
if str(ctx.author.id) in db:
|
if str(ctx.author.id) in db:
|
||||||
date = db[str(ctx.author.id)]
|
date = db[str(ctx.author.id)]
|
||||||
@@ -160,8 +160,8 @@ class Birthdays(commands.Cog):
|
|||||||
async def check_birthdays(self):
|
async def check_birthdays(self):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
today_date = now.strftime("%m-%d")
|
today_date = now.strftime("%m-%d")
|
||||||
db = read_db('jsondb/birthdays.json')
|
db = read_db(jsondb_path('birthdays.json'))
|
||||||
guild_settings = read_db('jsondb/birthday_logs.json')
|
guild_settings = read_db(jsondb_path('birthday_logs.json'))
|
||||||
|
|
||||||
for user_id, birthday in db.items():
|
for user_id, birthday in db.items():
|
||||||
if birthday.startswith(today_date):
|
if birthday.startswith(today_date):
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,20 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import os
|
import os
|
||||||
from core import Cog, zyrox, Context
|
from core import Cog, HexaHost, Context
|
||||||
import games as games
|
import games as games
|
||||||
from utils.Tools import *
|
from utils.Tools import *
|
||||||
from utils.cv2 import CV2
|
from utils.cv2 import CV2
|
||||||
@@ -26,9 +25,9 @@ import asyncio
|
|||||||
|
|
||||||
|
|
||||||
class Games(Cog):
|
class Games(Cog):
|
||||||
"""Zyrox Games"""
|
"""HexaHost Games"""
|
||||||
|
|
||||||
def __init__(self, client: zyrox):
|
def __init__(self, client: HexaHost):
|
||||||
self.client = client
|
self.client = client
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -23,7 +23,7 @@ from utils.config import *
|
|||||||
class Invcrole(commands.Cog):
|
class Invcrole(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.db_path = 'db/invc.db'
|
self.db_path = db_path('invc.db')
|
||||||
self.bot.loop.create_task(self.create_table())
|
self.bot.loop.create_task(self.create_table())
|
||||||
|
|
||||||
async def create_table(self):
|
async def create_table(self):
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
@@ -27,7 +27,7 @@ class Media(commands.Cog):
|
|||||||
|
|
||||||
|
|
||||||
async def set_db(self):
|
async def set_db(self):
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
await db.execute('''
|
await db.execute('''
|
||||||
CREATE TABLE IF NOT EXISTS media_channels (
|
CREATE TABLE IF NOT EXISTS media_channels (
|
||||||
guild_id INTEGER PRIMARY KEY,
|
guild_id INTEGER PRIMARY KEY,
|
||||||
@@ -62,7 +62,7 @@ class Media(commands.Cog):
|
|||||||
@commands.cooldown(1, 3, commands.BucketType.user)
|
@commands.cooldown(1, 3, commands.BucketType.user)
|
||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
async def setup(self, ctx, *, channel: discord.TextChannel):
|
async def setup(self, ctx, *, channel: discord.TextChannel):
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
async with db.execute('SELECT channel_id FROM media_channels WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
async with db.execute('SELECT channel_id FROM media_channels WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
if result:
|
if result:
|
||||||
@@ -80,7 +80,7 @@ class Media(commands.Cog):
|
|||||||
@commands.cooldown(1, 3, commands.BucketType.user)
|
@commands.cooldown(1, 3, commands.BucketType.user)
|
||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
async def remove(self, ctx):
|
async def remove(self, ctx):
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
async with db.execute('SELECT channel_id FROM media_channels WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
async with db.execute('SELECT channel_id FROM media_channels WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
if not result:
|
if not result:
|
||||||
@@ -98,7 +98,7 @@ class Media(commands.Cog):
|
|||||||
@commands.cooldown(1, 3, commands.BucketType.user)
|
@commands.cooldown(1, 3, commands.BucketType.user)
|
||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
async def config(self, ctx):
|
async def config(self, ctx):
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
async with db.execute('SELECT channel_id FROM media_channels WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
async with db.execute('SELECT channel_id FROM media_channels WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
if not result:
|
if not result:
|
||||||
@@ -124,7 +124,7 @@ class Media(commands.Cog):
|
|||||||
@commands.cooldown(1, 3, commands.BucketType.user)
|
@commands.cooldown(1, 3, commands.BucketType.user)
|
||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
async def bypass_add(self, ctx, user: discord.Member):
|
async def bypass_add(self, ctx, user: discord.Member):
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
async with db.execute('SELECT COUNT(*) FROM media_bypass WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
async with db.execute('SELECT COUNT(*) FROM media_bypass WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
||||||
count = await cursor.fetchone()
|
count = await cursor.fetchone()
|
||||||
if count[0] >= 25:
|
if count[0] >= 25:
|
||||||
@@ -148,7 +148,7 @@ class Media(commands.Cog):
|
|||||||
@commands.cooldown(1, 3, commands.BucketType.user)
|
@commands.cooldown(1, 3, commands.BucketType.user)
|
||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
async def bypass_remove(self, ctx, user: discord.Member):
|
async def bypass_remove(self, ctx, user: discord.Member):
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
async with db.execute('SELECT 1 FROM media_bypass WHERE guild_id = ? AND user_id = ?', (ctx.guild.id, user.id)) as cursor:
|
async with db.execute('SELECT 1 FROM media_bypass WHERE guild_id = ? AND user_id = ?', (ctx.guild.id, user.id)) as cursor:
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
if not result:
|
if not result:
|
||||||
@@ -166,7 +166,7 @@ class Media(commands.Cog):
|
|||||||
@commands.cooldown(1, 3, commands.BucketType.user)
|
@commands.cooldown(1, 3, commands.BucketType.user)
|
||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
async def bypass_show(self, ctx):
|
async def bypass_show(self, ctx):
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
async with db.execute('SELECT user_id FROM media_bypass WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
async with db.execute('SELECT user_id FROM media_bypass WHERE guild_id = ?', (ctx.guild.id,)) as cursor:
|
||||||
result = await cursor.fetchall()
|
result = await cursor.fetchall()
|
||||||
if not result:
|
if not result:
|
||||||
@@ -183,16 +183,16 @@ class Media(commands.Cog):
|
|||||||
if message.author.bot:
|
if message.author.bot:
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
async with db.execute('SELECT channel_id FROM media_channels WHERE guild_id = ?', (message.guild.id,)) as cursor:
|
async with db.execute('SELECT channel_id FROM media_channels WHERE guild_id = ?', (message.guild.id,)) as cursor:
|
||||||
media_channel = await cursor.fetchone()
|
media_channel = await cursor.fetchone()
|
||||||
|
|
||||||
if media_channel and message.channel.id == media_channel[0]:
|
if media_channel and message.channel.id == media_channel[0]:
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
async with block_db.execute('SELECT 1 FROM user_blacklist WHERE user_id = ?', (message.author.id,)) as cursor:
|
async with block_db.execute('SELECT 1 FROM user_blacklist WHERE user_id = ?', (message.author.id,)) as cursor:
|
||||||
blacklisted = await cursor.fetchone()
|
blacklisted = await cursor.fetchone()
|
||||||
|
|
||||||
async with aiosqlite.connect('db/media.db') as db:
|
async with aiosqlite.connect(db_path('media.db')) as db:
|
||||||
async with db.execute('SELECT 1 FROM media_bypass WHERE guild_id = ? AND user_id = ?', (message.guild.id, message.author.id)) as cursor:
|
async with db.execute('SELECT 1 FROM media_bypass WHERE guild_id = ? AND user_id = ?', (message.guild.id, message.author.id)) as cursor:
|
||||||
bypassed = await cursor.fetchone()
|
bypassed = await cursor.fetchone()
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ class Media(commands.Cog):
|
|||||||
]
|
]
|
||||||
|
|
||||||
if len(self.infractions[message.author.id]) >= 5:
|
if len(self.infractions[message.author.id]) >= 5:
|
||||||
async with aiosqlite.connect('db/block.db') as block_db:
|
async with aiosqlite.connect(db_path('block.db')) as block_db:
|
||||||
await block_db.execute('INSERT OR IGNORE INTO user_blacklist (user_id) VALUES (?)', (message.author.id,))
|
await block_db.execute('INSERT OR IGNORE INTO user_blacklist (user_id) VALUES (?)', (message.author.id,))
|
||||||
|
|
||||||
await block_db.commit()
|
await block_db.commit()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -24,7 +24,7 @@ from utils.cv2 import CV2, build_container
|
|||||||
from utils.emoji import TICK, MENTION, SEED, TIME
|
from utils.emoji import TICK, MENTION, SEED, TIME
|
||||||
from utils.config import *
|
from utils.config import *
|
||||||
|
|
||||||
DB_PATH = "db/afk.db"
|
DB_PATH = db_path("afk.db")
|
||||||
THEME_COLOR = 0xFF0000
|
THEME_COLOR = 0xFF0000
|
||||||
FOOTER_TEXT = f"Developed by {BRAND_NAME}"
|
FOOTER_TEXT = f"Developed by {BRAND_NAME}"
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import discord
|
import discord
|
||||||
@@ -323,7 +323,7 @@ class AI (commands .Cog ):
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
db_path ="db/ai_data.db"
|
db_path =db_path("ai_data.db")
|
||||||
if os .path .exists (db_path ):
|
if os .path .exists (db_path ):
|
||||||
try :
|
try :
|
||||||
|
|
||||||
@@ -401,7 +401,7 @@ class AI (commands .Cog ):
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
import os
|
import os
|
||||||
|
|
||||||
db_path ="db/ai_data.db"
|
db_path =db_path("ai_data.db")
|
||||||
if not os .path .exists (db_path ):
|
if not os .path .exists (db_path ):
|
||||||
logger .info ("AI database doesn't exist, will be created on first use")
|
logger .info ("AI database doesn't exist, will be created on first use")
|
||||||
return
|
return
|
||||||
@@ -590,7 +590,7 @@ class AI (commands .Cog ):
|
|||||||
|
|
||||||
system_context .append ({
|
system_context .append ({
|
||||||
"role":"system",
|
"role":"system",
|
||||||
"content":"You are a Discord bot with many features including moderation, entertainment, music, games, AI capabilities, and utilities. Support server: https://discord.gg/codexdev"
|
"content":"You are a Discord bot with many features including moderation, entertainment, music, games, AI capabilities, and utilities. Support server: https://discord.gg/hexahost"
|
||||||
})
|
})
|
||||||
else :
|
else :
|
||||||
|
|
||||||
@@ -602,7 +602,7 @@ You have a caring, helpful personality and can remember conversations with users
|
|||||||
|
|
||||||
Be natural, conversational, and genuine in your responses. Don't be overly formal or robotic. Use the conversation history to provide personalized responses that feel like talking to a real friend who happens to be very knowledgeable and helpful.
|
Be natural, conversational, and genuine in your responses. Don't be overly formal or robotic. Use the conversation history to provide personalized responses that feel like talking to a real friend who happens to be very knowledgeable and helpful.
|
||||||
|
|
||||||
Support server: https://discord.gg/codexdev"""
|
Support server: https://discord.gg/hexahost"""
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, MANAGER, REDDOT, TICK
|
from utils.emoji import CROSS, MANAGER, REDDOT, TICK
|
||||||
@@ -31,7 +31,7 @@ class Unwhitelist(commands.Cog):
|
|||||||
|
|
||||||
#@commands.Cog.listener()
|
#@commands.Cog.listener()
|
||||||
async def initialize_db(self):
|
async def initialize_db(self):
|
||||||
self.db = await aiosqlite.connect('db/anti.db')
|
self.db = await aiosqlite.connect(db_path('anti.db'))
|
||||||
|
|
||||||
@commands.hybrid_command(name='unwhitelist', aliases=['unwl'], help="Unwhitelist a user from antinuke")
|
@commands.hybrid_command(name='unwhitelist', aliases=['unwl'], help="Unwhitelist a user from antinuke")
|
||||||
@commands.has_permissions(administrator=True)
|
@commands.has_permissions(administrator=True)
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import ARROWRED, CROSS, DISABLE, ENABLE, MANAGER, TICK
|
from utils.emoji import ARROWRED, CROSS, DISABLE, ENABLE, MANAGER, TICK
|
||||||
@@ -32,7 +32,7 @@ class Whitelist(commands.Cog):
|
|||||||
|
|
||||||
#@commands.Cog.listener()
|
#@commands.Cog.listener()
|
||||||
async def initialize_db(self):
|
async def initialize_db(self):
|
||||||
self.db = await aiosqlite.connect('db/anti.db')
|
self.db = await aiosqlite.connect(db_path('anti.db'))
|
||||||
await self.db.execute('''
|
await self.db.execute('''
|
||||||
CREATE TABLE IF NOT EXISTS whitelisted_users (
|
CREATE TABLE IF NOT EXISTS whitelisted_users (
|
||||||
guild_id INTEGER,
|
guild_id INTEGER,
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, EMOTE, TICK, ZSAFE, ZSETTINGS
|
from utils.emoji import CROSS, EMOTE, TICK, ZSAFE, ZSETTINGS
|
||||||
@@ -31,7 +31,7 @@ class Antinuke(commands.Cog):
|
|||||||
self.bot.loop.create_task(self.initialize_db())
|
self.bot.loop.create_task(self.initialize_db())
|
||||||
|
|
||||||
async def initialize_db(self):
|
async def initialize_db(self):
|
||||||
self.db = await aiosqlite.connect('db/anti.db')
|
self.db = await aiosqlite.connect(db_path('anti.db'))
|
||||||
await self.db.execute('''
|
await self.db.execute('''
|
||||||
CREATE TABLE IF NOT EXISTS antinuke (
|
CREATE TABLE IF NOT EXISTS antinuke (
|
||||||
guild_id INTEGER PRIMARY KEY,
|
guild_id INTEGER PRIMARY KEY,
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, DISABLE, ENABLE, TICK, TICK_ALT
|
from utils.emoji import CROSS, DISABLE, ENABLE, TICK, TICK_ALT
|
||||||
@@ -113,7 +113,7 @@ class Automod(commands.Cog):
|
|||||||
self.bot.loop.create_task(self.init_db())
|
self.bot.loop.create_task(self.init_db())
|
||||||
|
|
||||||
async def get_exempt_roles_channels(self, guild_id):
|
async def get_exempt_roles_channels(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
roles_cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
roles_cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
||||||
channels_cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
channels_cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
||||||
|
|
||||||
@@ -124,18 +124,18 @@ class Automod(commands.Cog):
|
|||||||
|
|
||||||
|
|
||||||
async def is_automod_enabled(self, guild_id):
|
async def is_automod_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None and result[0] == 1
|
return result is not None and result[0] == 1
|
||||||
|
|
||||||
async def update_punishments(self, guild_id, event, punishment):
|
async def update_punishments(self, guild_id, event, punishment):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
await db.execute("INSERT OR REPLACE INTO automod_punishments (guild_id, event, punishment) VALUES (?, ?, ?)", (guild_id, event, punishment))
|
await db.execute("INSERT OR REPLACE INTO automod_punishments (guild_id, event, punishment) VALUES (?, ?, ?)", (guild_id, event, punishment))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
|
|
||||||
async def get_current_punishments(self, guild_id):
|
async def get_current_punishments(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
async with db.execute(
|
async with db.execute(
|
||||||
"SELECT event, punishment FROM automod_punishments WHERE guild_id = ? AND event != 'Anti NSFW link'",
|
"SELECT event, punishment FROM automod_punishments WHERE guild_id = ? AND event != 'Anti NSFW link'",
|
||||||
(guild_id,)
|
(guild_id,)
|
||||||
@@ -143,7 +143,7 @@ class Automod(commands.Cog):
|
|||||||
return await cursor.fetchall()
|
return await cursor.fetchall()
|
||||||
|
|
||||||
async def is_anti_nsfw_enabled(self, guild_id):
|
async def is_anti_nsfw_enabled(self, guild_id):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti NSFW link'", (guild_id,))
|
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti NSFW link'", (guild_id,))
|
||||||
result = await cursor.fetchone()
|
result = await cursor.fetchone()
|
||||||
return result is not None
|
return result is not None
|
||||||
@@ -151,7 +151,7 @@ class Automod(commands.Cog):
|
|||||||
|
|
||||||
|
|
||||||
async def init_db(self):
|
async def init_db(self):
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
await db.execute("""
|
await db.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS automod (
|
CREATE TABLE IF NOT EXISTS automod (
|
||||||
guild_id INTEGER PRIMARY KEY,
|
guild_id INTEGER PRIMARY KEY,
|
||||||
@@ -271,7 +271,7 @@ class Automod(commands.Cog):
|
|||||||
|
|
||||||
async def enable_automod(self, ctx, guild_id, selected_events, interaction):
|
async def enable_automod(self, ctx, guild_id, selected_events, interaction):
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
await db.execute("INSERT OR REPLACE INTO automod (guild_id, enabled) VALUES (?, 1)", (guild_id,))
|
await db.execute("INSERT OR REPLACE INTO automod (guild_id, enabled) VALUES (?, 1)", (guild_id,))
|
||||||
for event in selected_events:
|
for event in selected_events:
|
||||||
await db.execute("INSERT OR REPLACE INTO automod_punishments (guild_id, event, punishment) VALUES (?, ?, ?)", (guild_id, event, self.default_punishment))
|
await db.execute("INSERT OR REPLACE INTO automod_punishments (guild_id, event, punishment) VALUES (?, ?, ?)", (guild_id, event, self.default_punishment))
|
||||||
@@ -328,7 +328,7 @@ class Automod(commands.Cog):
|
|||||||
log_channel = await interaction.guild.create_text_channel(f"{BRAND_NAME.lower()}-automod", overwrites=overwrites)
|
log_channel = await interaction.guild.create_text_channel(f"{BRAND_NAME.lower()}-automod", overwrites=overwrites)
|
||||||
guild_id = interaction.guild.id
|
guild_id = interaction.guild.id
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
await db.execute("INSERT OR REPLACE INTO automod_logging (guild_id, log_channel) VALUES (?, ?)", (guild_id, log_channel.id))
|
await db.execute("INSERT OR REPLACE INTO automod_logging (guild_id, log_channel) VALUES (?, ?)", (guild_id, log_channel.id))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ class Automod(commands.Cog):
|
|||||||
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"Uhh, looks like your server hasn\'t enabled Automoderation.\n\nCurrent Status: {DISABLE} Disabled\nTo Enable use `{ctx.prefix}automod enable`"))
|
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"Uhh, looks like your server hasn\'t enabled Automoderation.\n\nCurrent Status: {DISABLE} Disabled\nTo Enable use `{ctx.prefix}automod enable`"))
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT 1 FROM automod_ignored WHERE guild_id = ? AND type = 'channel' AND id = ?", (guild_id, channel.id))
|
cursor = await db.execute("SELECT 1 FROM automod_ignored WHERE guild_id = ? AND type = 'channel' AND id = ?", (guild_id, channel.id))
|
||||||
if await cursor.fetchone() is not None:
|
if await cursor.fetchone() is not None:
|
||||||
await ctx.send(view=CV2("__Channel Already Whitelisted!__", f"{CROSS} The channel {channel.mention} is already in the ignore list.\n\n➜ Use **{ctx.prefix}automod unignore channel {channel.mention}** to remove it."))
|
await ctx.send(view=CV2("__Channel Already Whitelisted!__", f"{CROSS} The channel {channel.mention} is already in the ignore list.\n\n➜ Use **{ctx.prefix}automod unignore channel {channel.mention}** to remove it."))
|
||||||
@@ -491,7 +491,7 @@ class Automod(commands.Cog):
|
|||||||
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"Uhh, looks like your server hasn\'t enabled Automoderation.\n\nCurrent Status: {DISABLE} Disabled\nTo Enable use `{ctx.prefix}automod enable`"))
|
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"Uhh, looks like your server hasn\'t enabled Automoderation.\n\nCurrent Status: {DISABLE} Disabled\nTo Enable use `{ctx.prefix}automod enable`"))
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT 1 FROM automod_ignored WHERE guild_id = ? AND type = 'role' AND id = ?", (guild_id, role.id))
|
cursor = await db.execute("SELECT 1 FROM automod_ignored WHERE guild_id = ? AND type = 'role' AND id = ?", (guild_id, role.id))
|
||||||
|
|
||||||
if await cursor.fetchone() is not None:
|
if await cursor.fetchone() is not None:
|
||||||
@@ -545,7 +545,7 @@ class Automod(commands.Cog):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT type, id FROM automod_ignored WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT type, id FROM automod_ignored WHERE guild_id = ?", (guild_id,))
|
||||||
ignored_items = await cursor.fetchall()
|
ignored_items = await cursor.fetchall()
|
||||||
|
|
||||||
@@ -592,7 +592,7 @@ class Automod(commands.Cog):
|
|||||||
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"Uhh, looks like your server hasn\'t enabled Automoderation.\n\nCurrent Status: {DISABLE} Disabled\nTo Enable use `{ctx.prefix}automod enable`"))
|
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"Uhh, looks like your server hasn\'t enabled Automoderation.\n\nCurrent Status: {DISABLE} Disabled\nTo Enable use `{ctx.prefix}automod enable`"))
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
await db.execute("DELETE FROM automod_ignored WHERE guild_id = ?", (guild_id,))
|
await db.execute("DELETE FROM automod_ignored WHERE guild_id = ?", (guild_id,))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"** {TICK} | All ignored channels and roles have been reset!**\n\nTo view current Automod settings use `{ctx.prefix}automod config`"))
|
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"** {TICK} | All ignored channels and roles have been reset!**\n\nTo view current Automod settings use `{ctx.prefix}automod config`"))
|
||||||
@@ -639,7 +639,7 @@ class Automod(commands.Cog):
|
|||||||
except discord.HTTPException:
|
except discord.HTTPException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
result = await db.execute("DELETE FROM automod_ignored WHERE guild_id = ? AND type = 'channel' AND id = ?", (guild_id, channel.id))
|
result = await db.execute("DELETE FROM automod_ignored WHERE guild_id = ? AND type = 'channel' AND id = ?", (guild_id, channel.id))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
|
|
||||||
@@ -682,7 +682,7 @@ class Automod(commands.Cog):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
result = await db.execute("DELETE FROM automod_ignored WHERE guild_id = ? AND type = 'role' AND id = ?", (guild_id, role.id))
|
result = await db.execute("DELETE FROM automod_ignored WHERE guild_id = ? AND type = 'role' AND id = ?", (guild_id, role.id))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
|
|
||||||
@@ -719,7 +719,7 @@ class Automod(commands.Cog):
|
|||||||
|
|
||||||
elif view.value:
|
elif view.value:
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
await db.execute("DELETE FROM automod WHERE guild_id = ?", (guild_id,))
|
await db.execute("DELETE FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
await db.execute("DELETE FROM automod_punishments WHERE guild_id = ?", (guild_id,))
|
await db.execute("DELETE FROM automod_punishments WHERE guild_id = ?", (guild_id,))
|
||||||
await db.execute("DELETE FROM automod_ignored WHERE guild_id = ?", (guild_id,))
|
await db.execute("DELETE FROM automod_ignored WHERE guild_id = ?", (guild_id,))
|
||||||
@@ -768,7 +768,7 @@ class Automod(commands.Cog):
|
|||||||
items_str.append(f"**{event}**: {punishment or 'None'}")
|
items_str.append(f"**{event}**: {punishment or 'None'}")
|
||||||
if await self.is_anti_nsfw_enabled(guild_id):
|
if await self.is_anti_nsfw_enabled(guild_id):
|
||||||
items_str.append("**Anti NSFW Links**: Block Message")
|
items_str.append("**Anti NSFW Links**: Block Message")
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild_id,))
|
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild_id,))
|
||||||
log_channel_id = await cursor.fetchone()
|
log_channel_id = await cursor.fetchone()
|
||||||
if log_channel_id and log_channel_id[0]:
|
if log_channel_id and log_channel_id[0]:
|
||||||
@@ -799,7 +799,7 @@ class Automod(commands.Cog):
|
|||||||
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"Uhh, looks like your server hasn\'t enabled Automoderation.\n\nCurrent Status: {DISABLE} Disabled\nTo Enable use `{ctx.prefix}automod enable`"))
|
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"Uhh, looks like your server hasn\'t enabled Automoderation.\n\nCurrent Status: {DISABLE} Disabled\nTo Enable use `{ctx.prefix}automod enable`"))
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
await db.execute("INSERT OR REPLACE INTO automod_logging (guild_id, log_channel) VALUES (?, ?)", (guild_id, channel.id))
|
await db.execute("INSERT OR REPLACE INTO automod_logging (guild_id, log_channel) VALUES (?, ?)", (guild_id, channel.id))
|
||||||
await db.commit()
|
await db.commit()
|
||||||
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"**{TICK} | Automoderation Logging channel set to {channel.mention}.**\n\n➜ Use `{ctx.prefix}automod config` to view current Automod settings."))
|
await ctx.send(view=CV2(f"Automod Settings for {ctx.guild.name}", f"**{TICK} | Automoderation Logging channel set to {channel.mention}.**\n\n➜ Use `{ctx.prefix}automod config` to view current Automod settings."))
|
||||||
@@ -809,7 +809,7 @@ class Automod(commands.Cog):
|
|||||||
async def on_guild_remove(self, guild):
|
async def on_guild_remove(self, guild):
|
||||||
guild_id = guild.id
|
guild_id = guild.id
|
||||||
|
|
||||||
async with aiosqlite.connect("db/automod.db") as db:
|
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||||
await db.execute("DELETE FROM automod WHERE guild_id = ?", (guild_id,))
|
await db.execute("DELETE FROM automod WHERE guild_id = ?", (guild_id,))
|
||||||
await db.execute("DELETE FROM automod_punishments WHERE guild_id = ?", (guild_id,))
|
await db.execute("DELETE FROM automod_punishments WHERE guild_id = ?", (guild_id,))
|
||||||
await db.execute("DELETE FROM automod_ignored WHERE guild_id = ?", (guild_id,))
|
await db.execute("DELETE FROM automod_ignored WHERE guild_id = ?", (guild_id,))
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, ICONS_WARNING, TICK
|
from utils.emoji import CROSS, ICONS_WARNING, TICK
|
||||||
@@ -28,7 +28,7 @@ from utils.cv2 import CV2, build_container
|
|||||||
class AutoReaction(commands.Cog):
|
class AutoReaction(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.db_path = 'db/autoreact.db'
|
self.db_path = db_path('autoreact.db')
|
||||||
self.bot.loop.create_task(self.setup_database())
|
self.bot.loop.create_task(self.setup_database())
|
||||||
|
|
||||||
async def setup_database(self):
|
async def setup_database(self):
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, TICK
|
from utils.emoji import CROSS, TICK
|
||||||
@@ -25,7 +25,7 @@ from utils.cv2 import CV2, build_container
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DB_PATH = "db/autoresponder.db"
|
DB_PATH = db_path("autoresponder.db")
|
||||||
|
|
||||||
class AutoResponder(commands.Cog):
|
class AutoResponder(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from utils.db_paths import db_path
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, ICONS_WARNING, TICK
|
from utils.emoji import CROSS, ICONS_WARNING, TICK
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
@@ -33,7 +33,7 @@ logging.basicConfig(
|
|||||||
datefmt="%H:%M:%S",
|
datefmt="%H:%M:%S",
|
||||||
)
|
)
|
||||||
|
|
||||||
DATABASE_PATH = 'db/autorole.db'
|
DATABASE_PATH = db_path('autorole.db')
|
||||||
|
|
||||||
class BasicView(discord.ui.View):
|
class BasicView(discord.ui.View):
|
||||||
def __init__(self, ctx: commands.Context, timeout=60):
|
def __init__(self, ctx: commands.Context, timeout=60):
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, TICK
|
from utils.emoji import CROSS, TICK
|
||||||
@@ -55,7 +55,7 @@ class BlacklistWordSource(menus.ListPageSource):
|
|||||||
return embed
|
return embed
|
||||||
|
|
||||||
|
|
||||||
DB_PATH = "db/blword.db"
|
DB_PATH = db_path("blword.db")
|
||||||
|
|
||||||
|
|
||||||
async def create_blacklist_table():
|
async def create_blacklist_table():
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, TICK
|
from utils.emoji import CROSS, TICK
|
||||||
@@ -37,7 +37,7 @@ class Block(commands.Cog):
|
|||||||
|
|
||||||
#@commands.Cog.listener()
|
#@commands.Cog.listener()
|
||||||
async def set_db(self):
|
async def set_db(self):
|
||||||
async with aiosqlite.connect('db/block.db') as db:
|
async with aiosqlite.connect(db_path('block.db')) as db:
|
||||||
await db.execute('''
|
await db.execute('''
|
||||||
CREATE TABLE IF NOT EXISTS user_blacklist (
|
CREATE TABLE IF NOT EXISTS user_blacklist (
|
||||||
user_id INTEGER PRIMARY KEY,
|
user_id INTEGER PRIMARY KEY,
|
||||||
@@ -71,7 +71,7 @@ class Block(commands.Cog):
|
|||||||
@user.command(name="add", help="Adds a user to the blacklist.")
|
@user.command(name="add", help="Adds a user to the blacklist.")
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def add_user(self, ctx, user: discord.User):
|
async def add_user(self, ctx, user: discord.User):
|
||||||
async with aiosqlite.connect('db/block.db') as db:
|
async with aiosqlite.connect(db_path('block.db')) as db:
|
||||||
cursor = await db.execute('SELECT user_id FROM user_blacklist WHERE user_id = ?', (user.id,))
|
cursor = await db.execute('SELECT user_id FROM user_blacklist WHERE user_id = ?', (user.id,))
|
||||||
if await cursor.fetchone():
|
if await cursor.fetchone():
|
||||||
await ctx.reply(view=CV2("User Already Blacklisted", f"{user.mention} is already blacklisted."))
|
await ctx.reply(view=CV2("User Already Blacklisted", f"{user.mention} is already blacklisted."))
|
||||||
@@ -83,7 +83,7 @@ class Block(commands.Cog):
|
|||||||
@user.command(name="remove", help="Remove a user from the blacklist.")
|
@user.command(name="remove", help="Remove a user from the blacklist.")
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def remove_user(self, ctx, user: discord.User):
|
async def remove_user(self, ctx, user: discord.User):
|
||||||
async with aiosqlite.connect('db/block.db') as db:
|
async with aiosqlite.connect(db_path('block.db')) as db:
|
||||||
cursor = await db.execute('SELECT user_id FROM user_blacklist WHERE user_id = ?', (user.id,))
|
cursor = await db.execute('SELECT user_id FROM user_blacklist WHERE user_id = ?', (user.id,))
|
||||||
if not await cursor.fetchone():
|
if not await cursor.fetchone():
|
||||||
await ctx.reply(view=CV2(f"{CROSS} User Not Blacklisted", f"{user.mention} is not in the blacklist."))
|
await ctx.reply(view=CV2(f"{CROSS} User Not Blacklisted", f"{user.mention} is not in the blacklist."))
|
||||||
@@ -95,7 +95,7 @@ class Block(commands.Cog):
|
|||||||
@user.command(name="show", aliases=["list"], help="Shows all Blacklisted users.")
|
@user.command(name="show", aliases=["list"], help="Shows all Blacklisted users.")
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def show_users(self, ctx):
|
async def show_users(self, ctx):
|
||||||
async with aiosqlite.connect('db/block.db') as db:
|
async with aiosqlite.connect(db_path('block.db')) as db:
|
||||||
cursor = await db.execute('SELECT user_id FROM user_blacklist')
|
cursor = await db.execute('SELECT user_id FROM user_blacklist')
|
||||||
rows = await cursor.fetchall()
|
rows = await cursor.fetchall()
|
||||||
if not rows:
|
if not rows:
|
||||||
@@ -135,7 +135,7 @@ class Block(commands.Cog):
|
|||||||
@guild.command(name="add", help="Adds a guild to the blacklist.")
|
@guild.command(name="add", help="Adds a guild to the blacklist.")
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def add_guild(self, ctx, guild_id: int):
|
async def add_guild(self, ctx, guild_id: int):
|
||||||
async with aiosqlite.connect('db/block.db') as db:
|
async with aiosqlite.connect(db_path('block.db')) as db:
|
||||||
cursor = await db.execute('SELECT guild_id FROM guild_blacklist WHERE guild_id = ?', (guild_id,))
|
cursor = await db.execute('SELECT guild_id FROM guild_blacklist WHERE guild_id = ?', (guild_id,))
|
||||||
if await cursor.fetchone():
|
if await cursor.fetchone():
|
||||||
await ctx.reply(view=CV2(f"{CROSS} Guild Already Blacklisted", f"Guild with ID `{guild_id}` is already blacklisted."))
|
await ctx.reply(view=CV2(f"{CROSS} Guild Already Blacklisted", f"Guild with ID `{guild_id}` is already blacklisted."))
|
||||||
@@ -147,7 +147,7 @@ class Block(commands.Cog):
|
|||||||
@guild.command(name="remove", help="Remove a guild from the blacklist.")
|
@guild.command(name="remove", help="Remove a guild from the blacklist.")
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def remove_guild(self, ctx, guild_id: int):
|
async def remove_guild(self, ctx, guild_id: int):
|
||||||
async with aiosqlite.connect('db/block.db') as db:
|
async with aiosqlite.connect(db_path('block.db')) as db:
|
||||||
cursor = await db.execute('SELECT guild_id FROM guild_blacklist WHERE guild_id = ?', (guild_id,))
|
cursor = await db.execute('SELECT guild_id FROM guild_blacklist WHERE guild_id = ?', (guild_id,))
|
||||||
if not await cursor.fetchone():
|
if not await cursor.fetchone():
|
||||||
await ctx.reply(view=CV2(f"{CROSS} Guild Not Blacklisted", f"Guild with ID `{guild_id}` is not in the blacklist."))
|
await ctx.reply(view=CV2(f"{CROSS} Guild Not Blacklisted", f"Guild with ID `{guild_id}` is not in the blacklist."))
|
||||||
@@ -160,7 +160,7 @@ class Block(commands.Cog):
|
|||||||
@guild.command(name="show", aliases=["list"], help="Shows the list of blacklisted guilds")
|
@guild.command(name="show", aliases=["list"], help="Shows the list of blacklisted guilds")
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def show_guilds(self, ctx):
|
async def show_guilds(self, ctx):
|
||||||
async with aiosqlite.connect('db/block.db') as db:
|
async with aiosqlite.connect(db_path('block.db')) as db:
|
||||||
cursor = await db.execute('SELECT guild_id FROM guild_blacklist')
|
cursor = await db.execute('SELECT guild_id FROM guild_blacklist')
|
||||||
rows = await cursor.fetchall()
|
rows = await cursor.fetchall()
|
||||||
if not rows:
|
if not rows:
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, NITRO_BOOST, TICK, TIMER
|
from utils.emoji import CROSS, NITRO_BOOST, TICK, TIMER
|
||||||
import asyncio
|
import asyncio
|
||||||
@@ -28,7 +28,7 @@ import datetime
|
|||||||
import re
|
import re
|
||||||
from typing import *
|
from typing import *
|
||||||
from time import strftime
|
from time import strftime
|
||||||
from core import Cog ,zyrox ,Context
|
from core import Cog, HexaHost, Context
|
||||||
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
||||||
from utils.cv2 import CV2, build_container
|
from utils.cv2 import CV2, build_container
|
||||||
|
|
||||||
@@ -49,10 +49,10 @@ datefmt ="%H:%M:%S",
|
|||||||
)
|
)
|
||||||
|
|
||||||
class Booster (Cog ):
|
class Booster (Cog ):
|
||||||
def __init__ (self ,bot : Zyrox ):
|
def __init__ (self ,bot : HexaHost ):
|
||||||
self .bot =bot
|
self .bot =bot
|
||||||
self .color =0xFF0000
|
self .color =0xFF0000
|
||||||
self .db_path ="db/boost.db"
|
self .db_path =db_path("boost.db")
|
||||||
self .bot .loop .create_task (self .setup_database ())
|
self .bot .loop .create_task (self .setup_database ())
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
|
from utils.db_paths import db_path
|
||||||
from utils.emoji import ARROWRED, CROSS, NEXT_ALT1, REDRULESBOOK, RED_BUTTON, RED_PIN, STAR, TICK, ZBACK, ZPAUSE, ZPLAY, ZWARNING
|
from utils.emoji import ARROWRED, CROSS, NEXT_ALT1, REDRULESBOOK, RED_BUTTON, RED_PIN, STAR, TICK, ZBACK, ZPAUSE, ZPLAY, ZWARNING
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import json
|
import json
|
||||||
@@ -41,7 +41,7 @@ STAR = STAR
|
|||||||
class Counting(commands.Cog):
|
class Counting(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.data_file = "db/counting.json"
|
self.data_file = db_path("counting.json")
|
||||||
if not os.path.exists(self.data_file):
|
if not os.path.exists(self.data_file):
|
||||||
with open(self.data_file, 'w') as f:
|
with open(self.data_file, 'w') as f:
|
||||||
json.dump({}, f)
|
json.dump({}, f)
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, TICK, ZWARNING
|
from utils.emoji import CROSS, TICK, ZWARNING
|
||||||
@@ -27,8 +27,8 @@ from utils.config import *
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DATABASE_PATH = 'db/customrole.db'
|
DATABASE_PATH = db_path('customrole.db')
|
||||||
DATABASE_PATH2 = 'db/np.db'
|
DATABASE_PATH2 = db_path('np.db')
|
||||||
|
|
||||||
|
|
||||||
class Customrole(commands.Cog):
|
class Customrole(commands.Cog):
|
||||||
@@ -81,7 +81,7 @@ class Customrole(commands.Cog):
|
|||||||
|
|
||||||
|
|
||||||
async def handle_role_command(self, context: Context, member: discord.Member, role_type: str):
|
async def handle_role_command(self, context: Context, member: discord.Member, role_type: str):
|
||||||
async with aiosqlite.connect('db/customrole.db') as db:
|
async with aiosqlite.connect(db_path('customrole.db')) as db:
|
||||||
async with db.execute(f"SELECT reqrole, {role_type} FROM roles WHERE guild_id = ?", (context.guild.id,)) as cursor:
|
async with db.execute(f"SELECT reqrole, {role_type} FROM roles WHERE guild_id = ?", (context.guild.id,)) as cursor:
|
||||||
data = await cursor.fetchone()
|
data = await cursor.fetchone()
|
||||||
if data:
|
if data:
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, CROSS_ALT, ML_CROSS, TICK, TICK_ALT, ZWARNING
|
from utils.emoji import CROSS, CROSS_ALT, ML_CROSS, TICK, TICK_ALT, ZWARNING
|
||||||
@@ -374,7 +374,7 @@ class EmergencyRestoreResultView(LayoutView):
|
|||||||
class Emergency(commands.Cog):
|
class Emergency(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.db_path = "db/emergency.db"
|
self.db_path = db_path("emergency.db")
|
||||||
self.bot.loop.create_task(self.initialize_database())
|
self.bot.loop.create_task(self.initialize_database())
|
||||||
|
|
||||||
async def initialize_database(self):
|
async def initialize_database(self):
|
||||||
@@ -533,7 +533,7 @@ class Emergency(commands.Cog):
|
|||||||
is_owner = await self.is_guild_owner(ctx)
|
is_owner = await self.is_guild_owner(ctx)
|
||||||
if not is_owner:
|
if not is_owner:
|
||||||
return await ctx.reply(view=AuthoriseErrorView("owner_list"))
|
return await ctx.reply(view=AuthoriseErrorView("owner_list"))
|
||||||
async with aiosqlite.connect("db/emergency.db") as db:
|
async with aiosqlite.connect(db_path("emergency.db")) as db:
|
||||||
cursor = await db.execute(
|
cursor = await db.execute(
|
||||||
"SELECT user_id FROM authorised_users WHERE guild_id = ?",
|
"SELECT user_id FROM authorised_users WHERE guild_id = ?",
|
||||||
(ctx.guild.id,),
|
(ctx.guild.id,),
|
||||||
@@ -606,7 +606,7 @@ class Emergency(commands.Cog):
|
|||||||
is_auth = await self.is_guild_owner_or_authorised(ctx)
|
is_auth = await self.is_guild_owner_or_authorised(ctx)
|
||||||
if not is_auth:
|
if not is_auth:
|
||||||
return await ctx.reply(view=RoleErrorView("owner_list"))
|
return await ctx.reply(view=RoleErrorView("owner_list"))
|
||||||
async with aiosqlite.connect("db/emergency.db") as db:
|
async with aiosqlite.connect(db_path("emergency.db")) as db:
|
||||||
cursor = await db.execute(
|
cursor = await db.execute(
|
||||||
"SELECT role_id FROM emergency_roles WHERE guild_id = ?",
|
"SELECT role_id FROM emergency_roles WHERE guild_id = ?",
|
||||||
(ctx.guild.id,),
|
(ctx.guild.id,),
|
||||||
@@ -632,7 +632,7 @@ class Emergency(commands.Cog):
|
|||||||
guild_id = ctx.guild.id
|
guild_id = ctx.guild.id
|
||||||
|
|
||||||
antinuke_enabled = False
|
antinuke_enabled = False
|
||||||
async with aiosqlite.connect("db/anti.db") as anti:
|
async with aiosqlite.connect(db_path("anti.db")) as anti:
|
||||||
cursor = await anti.execute(
|
cursor = await anti.execute(
|
||||||
"SELECT status FROM antinuke WHERE guild_id = ?", (guild_id,)
|
"SELECT status FROM antinuke WHERE guild_id = ?", (guild_id,)
|
||||||
)
|
)
|
||||||
@@ -731,7 +731,7 @@ class Emergency(commands.Cog):
|
|||||||
await ctx.reply(view=result_view)
|
await ctx.reply(view=result_view)
|
||||||
|
|
||||||
if antinuke_enabled:
|
if antinuke_enabled:
|
||||||
async with aiosqlite.connect("db/anti.db") as anti:
|
async with aiosqlite.connect(db_path("anti.db")) as anti:
|
||||||
await anti.execute("INSERT INTO antinuke VALUES (?, 1)", (guild_id,))
|
await anti.execute("INSERT INTO antinuke VALUES (?, 1)", (guild_id,))
|
||||||
await anti.commit()
|
await anti.commit()
|
||||||
await proc_msg.delete()
|
await proc_msg.delete()
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import discord
|
import discord
|
||||||
@@ -30,7 +30,7 @@ from typing import *
|
|||||||
from utils import *
|
from utils import *
|
||||||
from utils.config import BotName, serverLink
|
from utils.config import BotName, serverLink
|
||||||
from utils import Paginator, DescriptionEmbedPaginator, FieldPagePaginator, TextPaginator
|
from utils import Paginator, DescriptionEmbedPaginator, FieldPagePaginator, TextPaginator
|
||||||
from core import Cog, zyrox, Context
|
from core import Cog, HexaHost, Context
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
import asyncio
|
import asyncio
|
||||||
@@ -887,7 +887,7 @@ class Extra(commands.Cog):
|
|||||||
|
|
||||||
db_latency = "Not Available"
|
db_latency = "Not Available"
|
||||||
try:
|
try:
|
||||||
async with aiosqlite.connect("db/afk.db") as db:
|
async with aiosqlite.connect(db_path("afk.db")) as db:
|
||||||
db_start_time = time.perf_counter()
|
db_start_time = time.perf_counter()
|
||||||
await db.execute("SELECT 1")
|
await db.execute("SELECT 1")
|
||||||
db_end_time = time.perf_counter()
|
db_end_time = time.perf_counter()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, TICK, ZWARNING
|
from utils.emoji import CROSS, TICK, ZWARNING
|
||||||
@@ -86,7 +86,7 @@ class Extraowner(commands.Cog):
|
|||||||
self.bot.loop.create_task(self.initialize_db())
|
self.bot.loop.create_task(self.initialize_db())
|
||||||
|
|
||||||
async def initialize_db(self):
|
async def initialize_db(self):
|
||||||
self.db = await aiosqlite.connect('db/anti.db')
|
self.db = await aiosqlite.connect(db_path('anti.db'))
|
||||||
await self.db.execute('''
|
await self.db.execute('''
|
||||||
CREATE TABLE IF NOT EXISTS extraowners (
|
CREATE TABLE IF NOT EXISTS extraowners (
|
||||||
guild_id INTEGER PRIMARY KEY,
|
guild_id INTEGER PRIMARY KEY,
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, TICK, ZWARNING, ZYROXCONNECTION, ZYROXLINKS
|
from utils.emoji import CROSS, TICK, ZWARNING, HEXAHOST_CONNECTION, HEXAHOST_LINKS
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
from discord.utils import get
|
from discord.utils import get
|
||||||
import datetime
|
import datetime
|
||||||
@@ -309,8 +308,8 @@ class General(commands.Cog):
|
|||||||
async def invite(self, ctx: commands.Context):
|
async def invite(self, ctx: commands.Context):
|
||||||
invite_text = (
|
invite_text = (
|
||||||
"```Empower your server with blazing-fast features and 24/7 support!```\n"
|
"```Empower your server with blazing-fast features and 24/7 support!```\n"
|
||||||
f"{ZYROXLINKS} **Quick Actions**\n"
|
f"{HEXAHOST_LINKS} **Quick Actions**\n"
|
||||||
f">>> **[Invite {BotName}](https://discord.com/oauth2/authorize?client_id=1396114795102470196&permissions=8&integration_type=0&scope=bot+applications.commands)**\n"
|
f">>> **[Invite {BotName}](https://discord.com/oauth2/authorize?client_id=1396114795102470196&permissions=8&integration_type=0&scope=bot+applications.commands)**\n"
|
||||||
"**[Support Server](https://discord.gg/codexdev)**"
|
"**[Support Server](https://discord.gg/hexahost)**"
|
||||||
)
|
)
|
||||||
await ctx.send(view=CV2(f"{ZYROXCONNECTION} {BotName} Integration Hub!", invite_text))
|
await ctx.send(view=CV2(f"{HEXAHOST_CONNECTION} {BotName} Integration Hub!", invite_text))
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@ from discord import app_commands, Interaction
|
|||||||
from difflib import get_close_matches
|
from difflib import get_close_matches
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from core import Context
|
from core import Context
|
||||||
from core.zyrox import zyrox
|
from core.hexahost import HexaHost
|
||||||
from core.Cog import Cog
|
from core.Cog import Cog
|
||||||
from utils.Tools import getConfig
|
from utils.Tools import getConfig
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
@@ -33,7 +32,6 @@ from utils.cv2 import CV2, CV2Embed
|
|||||||
from utils.config import *
|
from utils.config import *
|
||||||
|
|
||||||
color = 0xFF0000
|
color = 0xFF0000
|
||||||
client = zyrox()
|
|
||||||
|
|
||||||
from utils.config import BotName
|
from utils.config import BotName
|
||||||
|
|
||||||
@@ -157,7 +155,7 @@ class HelpCommand(commands.HelpCommand):
|
|||||||
)
|
)
|
||||||
|
|
||||||
embed.set_footer(
|
embed.set_footer(
|
||||||
text=f"Requested By {self.context.author} | [Support](https://discord.gg/codexdev)",
|
text=f"Requested By {self.context.author} | [Support](https://discord.gg/hexahost)",
|
||||||
)
|
)
|
||||||
|
|
||||||
view = vhelp.View(mapping=mapping, ctx=self.context, homeembed=embed, ui=2)
|
view = vhelp.View(mapping=mapping, ctx=self.context, homeembed=embed, ui=2)
|
||||||
@@ -175,9 +173,9 @@ class HelpCommand(commands.HelpCommand):
|
|||||||
await self.send_ignore_message(ctx, "command")
|
await self.send_ignore_message(ctx, "command")
|
||||||
return
|
return
|
||||||
|
|
||||||
zyrox = f">>> {command.help}" if command.help else '>>> No Help Provided...'
|
help_text = f">>> {command.help}" if command.help else '>>> No Help Provided...'
|
||||||
embed = CV2Embed(
|
embed = CV2Embed(
|
||||||
description=f"""{zyrox}""",
|
description=f"""{help_text}""",
|
||||||
color=color)
|
color=color)
|
||||||
alias = ' & '.join(command.aliases)
|
alias = ' & '.join(command.aliases)
|
||||||
|
|
||||||
@@ -270,7 +268,7 @@ class HelpCommand(commands.HelpCommand):
|
|||||||
|
|
||||||
class Help(Cog, name="help"):
|
class Help(Cog, name="help"):
|
||||||
|
|
||||||
def __init__(self, client: zyrox):
|
def __init__(self, client: HexaHost):
|
||||||
self._original_help_command = client.help_command
|
self._original_help_command = client.help_command
|
||||||
attributes = {
|
attributes = {
|
||||||
'name': "help",
|
'name': "help",
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class HelpCommand(commands.HelpCommand):
|
|||||||
matches = get_close_matches(string, cmds)
|
matches = get_close_matches(string, cmds)
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Zyrox Helper",
|
title="HexaHost Helper",
|
||||||
description=f">>> **Ops! Command not found with the name** `{string}`.",
|
description=f">>> **Ops! Command not found with the name** `{string}`.",
|
||||||
color=0xFF0000
|
color=0xFF0000
|
||||||
)
|
)
|
||||||
@@ -101,7 +101,7 @@ class HelpCommand(commands.HelpCommand):
|
|||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
description=(
|
description=(
|
||||||
f"**{ARROWRED} __Start Zyrox X Today__**\n"
|
f"**{ARROWRED} __Start HexaHost Today__**\n"
|
||||||
f"**{ZARROW} Type {prefix}antinuke enable**\n"
|
f"**{ZARROW} Type {prefix}antinuke enable**\n"
|
||||||
f"**{ZARROW} Server Prefix:** `{prefix}`\n"
|
f"**{ZARROW} Server Prefix:** `{prefix}`\n"
|
||||||
f"**{ZARROW} Total Commands:** `{len(set(self.context.bot.walk_commands()))}`\n"),
|
f"**{ZARROW} Total Commands:** `{len(set(self.context.bot.walk_commands()))}`\n"),
|
||||||
@@ -150,7 +150,7 @@ class HelpCommand(commands.HelpCommand):
|
|||||||
)
|
)
|
||||||
|
|
||||||
embed.set_footer(
|
embed.set_footer(
|
||||||
text=f"Requested By {self.context.author} | [Support](https://discord.gg/codexdev)",
|
text=f"Requested By {self.context.author} | [Support](https://discord.gg/hexahost)",
|
||||||
)
|
)
|
||||||
|
|
||||||
view = vhelp.View(mapping=mapping, ctx=self.context, homeembed=embed, ui=2)
|
view = vhelp.View(mapping=mapping, ctx=self.context, homeembed=embed, ui=2)
|
||||||
@@ -253,7 +253,7 @@ class HelpCommand(commands.HelpCommand):
|
|||||||
) for cmd in cog.get_commands()]
|
) for cmd in cog.get_commands()]
|
||||||
paginator = Paginator(source=FieldPagePaginator(
|
paginator = Paginator(source=FieldPagePaginator(
|
||||||
entries=entries,
|
entries=entries,
|
||||||
title=f"Zyrox's {cog.qualified_name.title()} ({len(cog.get_commands())})",
|
title=f"HexaHost's {cog.qualified_name.title()} ({len(cog.get_commands())})",
|
||||||
description="`<..> Required | [..] Optional`\n\n",
|
description="`<..> Required | [..] Optional`\n\n",
|
||||||
color=0xFF0000,
|
color=0xFF0000,
|
||||||
per_page=4),
|
per_page=4),
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from utils.db_paths import db_path
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, TICK, ZWARNING
|
from utils.emoji import CROSS, TICK, ZWARNING
|
||||||
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
||||||
@@ -98,7 +98,7 @@ class ListView(LayoutView):
|
|||||||
class Ignore(commands.Cog):
|
class Ignore(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.db_path = "db/ignore.db"
|
self.db_path = db_path("ignore.db")
|
||||||
self.color = 0xFF0000
|
self.color = 0xFF0000
|
||||||
bot.loop.create_task(self.initialize_db())
|
bot.loop.create_task(self.initialize_db())
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
@@ -19,7 +19,7 @@ from datetime import datetime, timedelta
|
|||||||
import re
|
import re
|
||||||
from utils.cv2 import CV2
|
from utils.cv2 import CV2
|
||||||
|
|
||||||
DB_FILE = "db/jail.db"
|
DB_FILE = db_path("jail.db")
|
||||||
|
|
||||||
class Jail(commands.Cog):
|
class Jail(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import jsondb_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import BLOBPART
|
from utils.emoji import BLOBPART
|
||||||
@@ -27,14 +27,14 @@ class joindm(commands.Cog):
|
|||||||
def load_joindm_messages(self):
|
def load_joindm_messages(self):
|
||||||
# Load the join DM messages from file
|
# Load the join DM messages from file
|
||||||
try:
|
try:
|
||||||
with open('jsondb/joindm_messages.json', 'r') as f:
|
with open(jsondb_path('joindm_messages.json'), 'r') as f:
|
||||||
self.joindm_messages = json.load(f)
|
self.joindm_messages = json.load(f)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
self.joindm_messages = {}
|
self.joindm_messages = {}
|
||||||
|
|
||||||
def save_joindm_messages(self):
|
def save_joindm_messages(self):
|
||||||
# Save the join DM messages to file
|
# Save the join DM messages to file
|
||||||
with open('jsondb/joindm_messages.json', 'w') as f:
|
with open(jsondb_path('joindm_messages.json'), 'w') as f:
|
||||||
json.dump(self.joindm_messages, f)
|
json.dump(self.joindm_messages, f)
|
||||||
|
|
||||||
@commands.group(invoke_without_command=True)
|
@commands.group(invoke_without_command=True)
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import CROSS, TICK, ZWARNING
|
from utils.emoji import CROSS, TICK, ZWARNING
|
||||||
@@ -212,7 +212,7 @@ class LevelConfigModal (discord .ui .Modal ,title ="Leveling System Configuratio
|
|||||||
|
|
||||||
|
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
|
|
||||||
async with db .execute ("SELECT guild_id FROM leveling_settings WHERE guild_id = ?",(interaction .guild .id ,))as cursor :
|
async with db .execute ("SELECT guild_id FROM leveling_settings WHERE guild_id = ?",(interaction .guild .id ,))as cursor :
|
||||||
exists =await cursor .fetchone ()
|
exists =await cursor .fetchone ()
|
||||||
@@ -291,7 +291,7 @@ class Leveling (commands .Cog ):
|
|||||||
self .bot =bot
|
self .bot =bot
|
||||||
self .message_cooldowns ={}
|
self .message_cooldowns ={}
|
||||||
self .last_level_cache ={}
|
self .last_level_cache ={}
|
||||||
self .db_path ="db/leveling.db"
|
self .db_path =db_path("leveling.db")
|
||||||
|
|
||||||
@commands.group (name ="level",invoke_without_command =True ,description ="Leveling system")
|
@commands.group (name ="level",invoke_without_command =True ,description ="Leveling system")
|
||||||
async def level (self ,ctx ):
|
async def level (self ,ctx ):
|
||||||
@@ -310,7 +310,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def init_database (self ):
|
async def init_database (self ):
|
||||||
"""Initialize all required database tables"""
|
"""Initialize all required database tables"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
|
|
||||||
await db .execute ("""
|
await db .execute ("""
|
||||||
CREATE TABLE IF NOT EXISTS user_xp (
|
CREATE TABLE IF NOT EXISTS user_xp (
|
||||||
@@ -411,13 +411,13 @@ class Leveling (commands .Cog ):
|
|||||||
max_retries =5
|
max_retries =5
|
||||||
for attempt in range (max_retries ):
|
for attempt in range (max_retries ):
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute ("SELECT * FROM leveling_settings WHERE guild_id = ?",(guild_id ,))as cursor :
|
async with db .execute ("SELECT * FROM leveling_settings WHERE guild_id = ?",(guild_id ,))as cursor :
|
||||||
row =await cursor .fetchone ()
|
row =await cursor .fetchone ()
|
||||||
|
|
||||||
if not row :
|
if not row :
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
await db .execute ("INSERT INTO leveling_settings (guild_id, enabled) VALUES (?, 0)",(guild_id ,))
|
await db .execute ("INSERT INTO leveling_settings (guild_id, enabled) VALUES (?, 0)",(guild_id ,))
|
||||||
await db .commit ()
|
await db .commit ()
|
||||||
return {
|
return {
|
||||||
@@ -474,7 +474,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def is_blacklisted (self ,guild_id :int ,user_id :int ,channel_id :int )->bool :
|
async def is_blacklisted (self ,guild_id :int ,user_id :int ,channel_id :int )->bool :
|
||||||
"""Check if user or channel is blacklisted"""
|
"""Check if user or channel is blacklisted"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
|
|
||||||
async with db .cursor ()as cursor :
|
async with db .cursor ()as cursor :
|
||||||
await cursor .execute ("PRAGMA table_info(leveling_blacklist)")
|
await cursor .execute ("PRAGMA table_info(leveling_blacklist)")
|
||||||
@@ -522,7 +522,7 @@ class Leveling (commands .Cog ):
|
|||||||
return 1.0
|
return 1.0
|
||||||
|
|
||||||
total_multiplier =1.0
|
total_multiplier =1.0
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
|
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT target_id, multiplier FROM xp_multipliers WHERE guild_id = ? AND target_type = 'role'",
|
"SELECT target_id, multiplier FROM xp_multipliers WHERE guild_id = ? AND target_type = 'role'",
|
||||||
@@ -593,7 +593,7 @@ class Leveling (commands .Cog ):
|
|||||||
final_xp =int (final_xp *multiplier )
|
final_xp =int (final_xp *multiplier )
|
||||||
|
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT xp, messages FROM user_xp WHERE guild_id = ? AND user_id = ?",
|
"SELECT xp, messages FROM user_xp WHERE guild_id = ? AND user_id = ?",
|
||||||
(guild_id ,user_id )
|
(guild_id ,user_id )
|
||||||
@@ -713,7 +713,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def give_level_rewards (self ,guild ,member ,level ):
|
async def give_level_rewards (self ,guild ,member ,level ):
|
||||||
"""Give role rewards for reaching a level"""
|
"""Give role rewards for reaching a level"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT role_id, remove_previous FROM level_rewards WHERE guild_id = ? AND level <= ? ORDER BY level DESC",
|
"SELECT role_id, remove_previous FROM level_rewards WHERE guild_id = ? AND level <= ? ORDER BY level DESC",
|
||||||
(guild .id ,level )
|
(guild .id ,level )
|
||||||
@@ -727,7 +727,7 @@ class Leveling (commands .Cog ):
|
|||||||
|
|
||||||
if remove_previous :
|
if remove_previous :
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT role_id FROM level_rewards WHERE guild_id = ? AND level < ?",
|
"SELECT role_id FROM level_rewards WHERE guild_id = ? AND level < ?",
|
||||||
(guild .id ,level )
|
(guild .id ,level )
|
||||||
@@ -745,7 +745,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def apply_level_roles (self ,guild ,member ,level ):
|
async def apply_level_roles (self ,guild ,member ,level ):
|
||||||
"""Apply level roles for reaching a level"""
|
"""Apply level roles for reaching a level"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT role_id FROM level_roles WHERE guild_id = ? AND level <= ? ORDER BY level DESC",
|
"SELECT role_id FROM level_roles WHERE guild_id = ? AND level <= ? ORDER BY level DESC",
|
||||||
(guild .id ,level )
|
(guild .id ,level )
|
||||||
@@ -768,7 +768,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def get_user_data (self ,guild_id :int ,user_id :int )->tuple :
|
async def get_user_data (self ,guild_id :int ,user_id :int )->tuple :
|
||||||
"""Get user XP and level data"""
|
"""Get user XP and level data"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT xp, messages FROM user_xp WHERE guild_id = ? AND user_id = ?",
|
"SELECT xp, messages FROM user_xp WHERE guild_id = ? AND user_id = ?",
|
||||||
(guild_id ,user_id )
|
(guild_id ,user_id )
|
||||||
@@ -786,7 +786,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def get_user_rank (self ,guild_id :int ,user_id :int )->int :
|
async def get_user_rank (self ,guild_id :int ,user_id :int )->int :
|
||||||
"""Get user's rank in the guild"""
|
"""Get user's rank in the guild"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT COUNT(*) + 1 FROM user_xp WHERE guild_id = ? AND xp > (SELECT COALESCE(xp, 0) FROM user_xp WHERE guild_id = ? AND user_id = ?)",
|
"SELECT COUNT(*) + 1 FROM user_xp WHERE guild_id = ? AND xp > (SELECT COALESCE(xp, 0) FROM user_xp WHERE guild_id = ? AND user_id = ?)",
|
||||||
(guild_id ,guild_id ,user_id )
|
(guild_id ,guild_id ,user_id )
|
||||||
@@ -1751,7 +1751,7 @@ class Leveling (commands .Cog ):
|
|||||||
embed_color_int =hex_to_int (embed_color )
|
embed_color_int =hex_to_int (embed_color )
|
||||||
level_image_final =level_image if level_image and level_image .strip ()else None
|
level_image_final =level_image if level_image and level_image .strip ()else None
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
|
|
||||||
async with db .execute ("SELECT guild_id FROM leveling_settings WHERE guild_id = ?",(ctx .guild .id ,))as cursor :
|
async with db .execute ("SELECT guild_id FROM leveling_settings WHERE guild_id = ?",(ctx .guild .id ,))as cursor :
|
||||||
exists =await cursor .fetchone ()
|
exists =await cursor .fetchone ()
|
||||||
@@ -2014,7 +2014,7 @@ class Leveling (commands .Cog ):
|
|||||||
await ctx .send ("Level must be greater than 0.")
|
await ctx .send ("Level must be greater than 0.")
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
await db .execute (
|
await db .execute (
|
||||||
"INSERT OR REPLACE INTO level_rewards (guild_id, level, role_id, remove_previous) VALUES (?, ?, ?, ?)",
|
"INSERT OR REPLACE INTO level_rewards (guild_id, level, role_id, remove_previous) VALUES (?, ?, ?, ?)",
|
||||||
(ctx .guild .id ,level ,role .id ,int (remove_previous ))
|
(ctx .guild .id ,level ,role .id ,int (remove_previous ))
|
||||||
@@ -2031,7 +2031,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def rewards_remove (self ,ctx ,level :int ):
|
async def rewards_remove (self ,ctx ,level :int ):
|
||||||
"""Remove level reward"""
|
"""Remove level reward"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
await db .execute (
|
await db .execute (
|
||||||
"DELETE FROM level_rewards WHERE guild_id = ? AND level = ?",
|
"DELETE FROM level_rewards WHERE guild_id = ? AND level = ?",
|
||||||
(ctx .guild .id ,level )
|
(ctx .guild .id ,level )
|
||||||
@@ -2048,7 +2048,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def rewards_list (self ,ctx ):
|
async def rewards_list (self ,ctx ):
|
||||||
"""List level rewards"""
|
"""List level rewards"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT level, role_id, remove_previous FROM level_rewards WHERE guild_id = ? ORDER BY level",
|
"SELECT level, role_id, remove_previous FROM level_rewards WHERE guild_id = ? ORDER BY level",
|
||||||
(ctx .guild .id ,)
|
(ctx .guild .id ,)
|
||||||
@@ -2104,7 +2104,7 @@ class Leveling (commands .Cog ):
|
|||||||
await ctx .send ("Invalid channel ID.")
|
await ctx .send ("Invalid channel ID.")
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
await db .execute (
|
await db .execute (
|
||||||
"INSERT OR REPLACE INTO xp_multipliers (guild_id, target_id, target_type, multiplier) VALUES (?, ?, ?, ?)",
|
"INSERT OR REPLACE INTO xp_multipliers (guild_id, target_id, target_type, multiplier) VALUES (?, ?, ?, ?)",
|
||||||
(ctx .guild .id ,target_id ,target_type ,multiplier )
|
(ctx .guild .id ,target_id ,target_type ,multiplier )
|
||||||
@@ -2140,7 +2140,7 @@ class Leveling (commands .Cog ):
|
|||||||
await ctx .send ("Invalid channel ID.")
|
await ctx .send ("Invalid channel ID.")
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
await db .execute (
|
await db .execute (
|
||||||
"DELETE FROM xp_multipliers WHERE guild_id = ? AND target_id = ? AND target_type = ?",
|
"DELETE FROM xp_multipliers WHERE guild_id = ? AND target_id = ? AND target_type = ?",
|
||||||
(ctx .guild .id ,target_id ,target_type )
|
(ctx .guild .id ,target_id ,target_type )
|
||||||
@@ -2157,7 +2157,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def multiplier_list (self ,ctx ):
|
async def multiplier_list (self ,ctx ):
|
||||||
"""List XP multipliers"""
|
"""List XP multipliers"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT target_id, target_type, multiplier FROM xp_multipliers WHERE guild_id = ?",
|
"SELECT target_id, target_type, multiplier FROM xp_multipliers WHERE guild_id = ?",
|
||||||
(ctx .guild .id ,)
|
(ctx .guild .id ,)
|
||||||
@@ -2213,7 +2213,7 @@ class Leveling (commands .Cog ):
|
|||||||
await ctx .send ("Invalid channel ID.")
|
await ctx .send ("Invalid channel ID.")
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
await db .execute (
|
await db .execute (
|
||||||
"INSERT OR REPLACE INTO leveling_blacklist (guild_id, target_id, target_type) VALUES (?, ?, ?)",
|
"INSERT OR REPLACE INTO leveling_blacklist (guild_id, target_id, target_type) VALUES (?, ?, ?)",
|
||||||
(ctx .guild .id ,target_id ,target_type )
|
(ctx .guild .id ,target_id ,target_type )
|
||||||
@@ -2249,7 +2249,7 @@ class Leveling (commands .Cog ):
|
|||||||
await ctx .send ("Invalid channel ID.")
|
await ctx .send ("Invalid channel ID.")
|
||||||
return
|
return
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
await db .execute (
|
await db .execute (
|
||||||
"DELETE FROM leveling_blacklist WHERE guild_id = ? AND target_id = ? AND target_type = ?",
|
"DELETE FROM leveling_blacklist WHERE guild_id = ? AND target_id = ? AND target_type = ?",
|
||||||
(ctx .guild .id ,target_id ,target_type )
|
(ctx .guild .id ,target_id ,target_type )
|
||||||
@@ -2266,7 +2266,7 @@ class Leveling (commands .Cog ):
|
|||||||
async def blacklist_list (self ,ctx ):
|
async def blacklist_list (self ,ctx ):
|
||||||
"""List leveling blacklist"""
|
"""List leveling blacklist"""
|
||||||
try :
|
try :
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT target_id, target_type FROM leveling_blacklist WHERE guild_id = ?",
|
"SELECT target_id, target_type FROM leveling_blacklist WHERE guild_id = ?",
|
||||||
(ctx .guild .id ,)
|
(ctx .guild .id ,)
|
||||||
@@ -2422,7 +2422,7 @@ class Leveling (commands .Cog ):
|
|||||||
if isinstance (ctx ,discord .Interaction ):
|
if isinstance (ctx ,discord .Interaction ):
|
||||||
await ctx .response .defer ()
|
await ctx .response .defer ()
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
|
|
||||||
cursor =await db .execute ('''
|
cursor =await db .execute ('''
|
||||||
SELECT user_id, xp, messages FROM user_xp
|
SELECT user_id, xp, messages FROM user_xp
|
||||||
@@ -3013,7 +3013,7 @@ class Leveling (commands .Cog ):
|
|||||||
percentage =(progress /needed *100 )if needed >0 else 100
|
percentage =(progress /needed *100 )if needed >0 else 100
|
||||||
|
|
||||||
|
|
||||||
async with aiosqlite .connect ("db/leveling.db")as db :
|
async with aiosqlite .connect (db_path("leveling.db"))as db :
|
||||||
async with db .execute (
|
async with db .execute (
|
||||||
"SELECT COUNT(*) FROM user_xp WHERE guild_id = ? AND xp > 0",
|
"SELECT COUNT(*) FROM user_xp WHERE guild_id = ? AND xp > 0",
|
||||||
(guild_id ,)
|
(guild_id ,)
|
||||||
|
|||||||
Binary file not shown.
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import jsondb_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -43,7 +43,7 @@ LOG_CATEGORIES = [
|
|||||||
"system_events",
|
"system_events",
|
||||||
]
|
]
|
||||||
|
|
||||||
CONFIG_FILE = "jsondb/logging_config.json"
|
CONFIG_FILE = jsondb_path("logging_config.json")
|
||||||
LOGS_DIR = "logs"
|
LOGS_DIR = "logs"
|
||||||
MAX_AUDIT_CACHE_SIZE = 1000
|
MAX_AUDIT_CACHE_SIZE = 1000
|
||||||
AUDIT_CACHE_TTL = 300
|
AUDIT_CACHE_TTL = 300
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -92,7 +91,7 @@ class MapView(LayoutView):
|
|||||||
|
|
||||||
def get_coordinates(self, location):
|
def get_coordinates(self, location):
|
||||||
try:
|
try:
|
||||||
headers = {'User-Agent': f'{BRAND_NAME} Bot (https://codexdevs.in)'}
|
headers = {'User-Agent': f'{BRAND_NAME} Bot (https://hexahost.dev)'}
|
||||||
response = requests.get(f'https://nominatim.openstreetmap.org/search?q={location}&format=json', headers=headers)
|
response = requests.get(f'https://nominatim.openstreetmap.org/search?q={location}&format=json', headers=headers)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
data = response.json()[0]
|
data = response.json()[0]
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import ARROWRED
|
from utils.emoji import ARROWRED
|
||||||
@@ -34,7 +34,7 @@ class MessagesView(LayoutView):
|
|||||||
f"**Daily Messages**: {daily_average}\n"
|
f"**Daily Messages**: {daily_average}\n"
|
||||||
f"**Today Messages**: {today_count}\n"
|
f"**Today Messages**: {today_count}\n"
|
||||||
f"**Total Messages**: {total}\n\n"
|
f"**Total Messages**: {total}\n\n"
|
||||||
f"**{ARROWRED}Upgrade Your Experience With [{BRAND_NAME} Noprefix](https://discord.gg/codexdev)**"
|
f"**{ARROWRED}Upgrade Your Experience With [{BRAND_NAME} Noprefix](https://discord.gg/hexahost)**"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -49,7 +49,7 @@ class Messages(commands.Cog):
|
|||||||
if message.author.bot or not message.guild:
|
if message.author.bot or not message.guild:
|
||||||
return
|
return
|
||||||
|
|
||||||
conn = sqlite3.connect("db/messages.db")
|
conn = sqlite3.connect(db_path("messages.db"))
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute("""
|
c.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS messages (
|
CREATE TABLE IF NOT EXISTS messages (
|
||||||
@@ -86,7 +86,7 @@ class Messages(commands.Cog):
|
|||||||
member = member or ctx.author
|
member = member or ctx.author
|
||||||
today = datetime.utcnow().strftime("%Y-%m-%d")
|
today = datetime.utcnow().strftime("%Y-%m-%d")
|
||||||
|
|
||||||
conn = sqlite3.connect("db/messages.db")
|
conn = sqlite3.connect(db_path("messages.db"))
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute(
|
c.execute(
|
||||||
"SELECT date, count FROM messages WHERE guild_id = ? AND user_id = ?",
|
"SELECT date, count FROM messages WHERE guild_id = ? AND user_id = ?",
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
@@ -30,7 +30,7 @@ from utils.emoji import SUCCESS, ERROR, WARNING_UNICODE, CLOCK, REFRESH, JAVA_CO
|
|||||||
ASSETS_DIR = "assets"
|
ASSETS_DIR = "assets"
|
||||||
FONT_PATH = os.path.join(ASSETS_DIR, "fonts", "minecraft.ttf")
|
FONT_PATH = os.path.join(ASSETS_DIR, "fonts", "minecraft.ttf")
|
||||||
BACKGROUND_PATH = os.path.join(ASSETS_DIR, "background", "background.png")
|
BACKGROUND_PATH = os.path.join(ASSETS_DIR, "background", "background.png")
|
||||||
DB_PATH = "db/minecraft.db"
|
DB_PATH = db_path("minecraft.db")
|
||||||
|
|
||||||
# --- Other Constants ---
|
# --- Other Constants ---
|
||||||
REFRESH_COOLDOWN_SECONDS = 30
|
REFRESH_COOLDOWN_SECONDS = 30
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -28,7 +28,7 @@ class Messagespack(commands.Cog):
|
|||||||
return await ctx.send("Amount must be greater than 0.")
|
return await ctx.send("Amount must be greater than 0.")
|
||||||
|
|
||||||
today = datetime.utcnow().strftime("%Y-%m-%d")
|
today = datetime.utcnow().strftime("%Y-%m-%d")
|
||||||
conn = sqlite3.connect("db/messages.db")
|
conn = sqlite3.connect(db_path("messages.db"))
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
|
|
||||||
c.execute("SELECT count FROM messages WHERE guild_id = ? AND user_id = ? AND date = ?",
|
c.execute("SELECT count FROM messages WHERE guild_id = ? AND user_id = ? AND date = ?",
|
||||||
@@ -53,7 +53,7 @@ class Messagespack(commands.Cog):
|
|||||||
return await ctx.send("Amount must be greater than 0.")
|
return await ctx.send("Amount must be greater than 0.")
|
||||||
|
|
||||||
today = datetime.utcnow().strftime("%Y-%m-%d")
|
today = datetime.utcnow().strftime("%Y-%m-%d")
|
||||||
conn = sqlite3.connect("db/messages.db")
|
conn = sqlite3.connect(db_path("messages.db"))
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
|
|
||||||
c.execute("SELECT count FROM messages WHERE guild_id = ? AND user_id = ? AND date = ?",
|
c.execute("SELECT count FROM messages WHERE guild_id = ? AND user_id = ? AND date = ?",
|
||||||
@@ -73,7 +73,7 @@ class Messagespack(commands.Cog):
|
|||||||
@commands.command(name="clearmessage", aliases=["clearmsg"])
|
@commands.command(name="clearmessage", aliases=["clearmsg"])
|
||||||
@commands.has_permissions(manage_messages=True)
|
@commands.has_permissions(manage_messages=True)
|
||||||
async def clearmessage(self, ctx, member: discord.Member):
|
async def clearmessage(self, ctx, member: discord.Member):
|
||||||
conn = sqlite3.connect("db/messages.db")
|
conn = sqlite3.connect(db_path("messages.db"))
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute("DELETE FROM messages WHERE guild_id = ? AND user_id = ?",
|
c.execute("DELETE FROM messages WHERE guild_id = ? AND user_id = ?",
|
||||||
(ctx.guild.id, member.id))
|
(ctx.guild.id, member.id))
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -22,7 +21,7 @@ from discord.ui import Button, View, LayoutView, TextDisplay, Separator, Contain
|
|||||||
import wavelink
|
import wavelink
|
||||||
from wavelink.enums import TrackSource
|
from wavelink.enums import TrackSource
|
||||||
from utils import Paginator, DescriptionEmbedPaginator
|
from utils import Paginator, DescriptionEmbedPaginator
|
||||||
from core import Cog, zyrox, Context
|
from core import Cog, HexaHost, Context
|
||||||
from PIL import Image, ImageDraw, ImageFont, ImageOps
|
from PIL import Image, ImageDraw, ImageFont, ImageOps
|
||||||
import io
|
import io
|
||||||
import aiohttp
|
import aiohttp
|
||||||
@@ -335,7 +334,7 @@ class MusicControlView(LayoutView):
|
|||||||
|
|
||||||
|
|
||||||
class Music(commands.Cog):
|
class Music(commands.Cog):
|
||||||
def __init__(self, client: zyrox):
|
def __init__(self, client: HexaHost):
|
||||||
self.client = client
|
self.client = client
|
||||||
self.client.loop.create_task(self.connect_nodes())
|
self.client.loop.create_task(self.connect_nodes())
|
||||||
self.client.loop.create_task(self.monitor_inactivity())
|
self.client.loop.create_task(self.monitor_inactivity())
|
||||||
@@ -374,7 +373,7 @@ class Music(commands.Cog):
|
|||||||
if player:
|
if player:
|
||||||
await player.disconnect(force=True)
|
await player.disconnect(force=True)
|
||||||
try:
|
try:
|
||||||
support = Button(label='Support', style=discord.ButtonStyle.link, url='https://discord.gg/codexdev')
|
support = Button(label='Support', style=discord.ButtonStyle.link, url='https://discord.gg/hexahost')
|
||||||
vote = Button(label='Vote', style=discord.ButtonStyle.link, url='https://top.gg/bot//vote')
|
vote = Button(label='Vote', style=discord.ButtonStyle.link, url='https://top.gg/bot//vote')
|
||||||
view = LayoutView(timeout=None)
|
view = LayoutView(timeout=None)
|
||||||
container = build_container(
|
container = build_container(
|
||||||
@@ -423,7 +422,7 @@ class Music(commands.Cog):
|
|||||||
await player.ctx.send(view=CV2("No suitable track found for autoplay."))
|
await player.ctx.send(view=CV2("No suitable track found for autoplay."))
|
||||||
else:
|
else:
|
||||||
await player.disconnect()
|
await player.disconnect()
|
||||||
support = Button(label='Support', style=discord.ButtonStyle.link, url='https://discord.gg/codexdev')
|
support = Button(label='Support', style=discord.ButtonStyle.link, url='https://discord.gg/hexahost')
|
||||||
vote = Button(label='Vote', style=discord.ButtonStyle.link, url='https://top.gg/bot//vote')
|
vote = Button(label='Vote', style=discord.ButtonStyle.link, url='https://top.gg/bot//vote')
|
||||||
view = LayoutView(timeout=None)
|
view = LayoutView(timeout=None)
|
||||||
container = build_container(
|
container = build_container(
|
||||||
@@ -473,7 +472,7 @@ class Music(commands.Cog):
|
|||||||
|
|
||||||
if isinstance(tracks, wavelink.Playlist):
|
if isinstance(tracks, wavelink.Playlist):
|
||||||
await vc.queue.put_wait(tracks.tracks)
|
await vc.queue.put_wait(tracks.tracks)
|
||||||
await ctx.send(view=CV2(f"{ZPLUS} Added playlist [{tracks.name}](https://discord.gg/codexdev) with **{len(tracks.tracks)} songs** to the queue."))
|
await ctx.send(view=CV2(f"{ZPLUS} Added playlist [{tracks.name}](https://discord.gg/hexahost) with **{len(tracks.tracks)} songs** to the queue."))
|
||||||
if not vc.playing:
|
if not vc.playing:
|
||||||
track = await vc.queue.get_wait()
|
track = await vc.queue.get_wait()
|
||||||
await vc.play(track)
|
await vc.play(track)
|
||||||
@@ -481,7 +480,7 @@ class Music(commands.Cog):
|
|||||||
else:
|
else:
|
||||||
track = tracks[0]
|
track = tracks[0]
|
||||||
await vc.queue.put_wait(track)
|
await vc.queue.put_wait(track)
|
||||||
await ctx.send(view=CV2(f"{ZPLUS} Added [{track.title}](https://discord.gg/codexdev) to the queue."))
|
await ctx.send(view=CV2(f"{ZPLUS} Added [{track.title}](https://discord.gg/hexahost) to the queue."))
|
||||||
if not vc.playing:
|
if not vc.playing:
|
||||||
await vc.play(await vc.queue.get_wait())
|
await vc.play(await vc.queue.get_wait())
|
||||||
await self.display_player_embed(vc, track, ctx)
|
await self.display_player_embed(vc, track, ctx)
|
||||||
@@ -510,7 +509,7 @@ class Music(commands.Cog):
|
|||||||
|
|
||||||
track = search_results[0]
|
track = search_results[0]
|
||||||
await vc.queue.put_wait(track)
|
await vc.queue.put_wait(track)
|
||||||
await ctx.send(view=CV2(f"{ZPLUS} Added [{track.title}](https://discord.gg/codexdev) to the queue."))
|
await ctx.send(view=CV2(f"{ZPLUS} Added [{track.title}](https://discord.gg/hexahost) to the queue."))
|
||||||
if not vc.playing:
|
if not vc.playing:
|
||||||
await vc.play(track)
|
await vc.play(track)
|
||||||
await self.display_player_embed(vc, track, ctx)
|
await self.display_player_embed(vc, track, ctx)
|
||||||
@@ -541,7 +540,7 @@ class Music(commands.Cog):
|
|||||||
c += 1
|
c += 1
|
||||||
await ctx.message.add_reaction("✅")
|
await ctx.message.add_reaction("✅")
|
||||||
|
|
||||||
await ctx.send(view=CV2(f"{ZPLUS} Added **{c}** of **{playlist_length}** tracks from **playlist** **[{playlist_info['name']}](https://discord.gg/codexdev)** to the queue."))
|
await ctx.send(view=CV2(f"{ZPLUS} Added **{c}** of **{playlist_length}** tracks from **playlist** **[{playlist_info['name']}](https://discord.gg/hexahost)** to the queue."))
|
||||||
await lmao.delete()
|
await lmao.delete()
|
||||||
|
|
||||||
if not vc.playing:
|
if not vc.playing:
|
||||||
@@ -569,7 +568,7 @@ class Music(commands.Cog):
|
|||||||
if track_results:
|
if track_results:
|
||||||
await vc.queue.put_wait(track_results[0])
|
await vc.queue.put_wait(track_results[0])
|
||||||
|
|
||||||
await ctx.send(view=CV2(f"{ZPLUS} Added all tracks from album **[{album_info['name']}](https://discord.gg/codexdev)** to the queue."))
|
await ctx.send(view=CV2(f"{ZPLUS} Added all tracks from album **[{album_info['name']}](https://discord.gg/hexahost)** to the queue."))
|
||||||
if not vc.playing:
|
if not vc.playing:
|
||||||
next_track = await vc.queue.get_wait()
|
next_track = await vc.queue.get_wait()
|
||||||
await vc.play(next_track)
|
await vc.play(next_track)
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
@@ -44,7 +43,7 @@ class Nitro(commands.Cog):
|
|||||||
claim_button = Button(
|
claim_button = Button(
|
||||||
style=discord.ButtonStyle.primary,
|
style=discord.ButtonStyle.primary,
|
||||||
label="Click me!",
|
label="Click me!",
|
||||||
url="https://discord.gg/codexdev",
|
url="https://discord.gg/hexahost",
|
||||||
disabled=False,
|
disabled=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -22,7 +22,7 @@ from utils.cv2 import CV2
|
|||||||
class NotifCommands(commands.Cog):
|
class NotifCommands(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.db_path = "db/notify.db"
|
self.db_path = db_path("notify.db")
|
||||||
self.loop_task = self.bot.loop.create_task(self.setup_db())
|
self.loop_task = self.bot.loop.create_task(self.setup_db())
|
||||||
|
|
||||||
async def setup_db(self):
|
async def setup_db(self):
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
# ╔══════════════════════════════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════════════════════════════╗
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
# ║ |H|e|x|a|H|o|s|t| ║
|
||||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ║ discord ── https://discord.gg/codexdev ║
|
# ║ discord ── https://discord.gg/hexahost ║
|
||||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
# ║ github ── https://github.com/theoneandonlymace ║
|
||||||
# ║ github ── https://github.com/RayExo ║
|
|
||||||
# ║ ║
|
# ║ ║
|
||||||
# ╚══════════════════════════════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════════════════════════════╝
|
||||||
|
from utils.db_paths import db_path
|
||||||
|
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
from discord import *
|
from discord import *
|
||||||
import discord
|
import discord
|
||||||
from utils.emoji import BOOST, ICONS_WARNING, INFO, MENTION, PREMIUM, TICK, TIME, TIMER_ALT1, U_ADMIN, ZDIL, ZHUMAN, ZYROXHAMMER, ZYROXSYS
|
from utils.emoji import BOOST, ICONS_WARNING, INFO, MENTION, PREMIUM, TICK, TIME, TIMER_ALT1, U_ADMIN, ZDIL, ZHUMAN, HEXAHOST_HAMMER, HEXAHOST_SYS
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
@@ -143,7 +143,7 @@ class TimeSelect(Select):
|
|||||||
await log_channel.send(view=embed)
|
await log_channel.send(view=embed)
|
||||||
|
|
||||||
embed = CV2Embed(
|
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}",
|
description=f"**Added Global No Prefix**:\n{ZHUMAN} User: **{self.user.mention}**\n{MENTION} User Mention: {self.user.mention}\n{HEXAHOST_SYS} User ID: {self.user.id}\n\n__**Additional Info**__:\n{HEXAHOST_HAMMER} Added By: **{self.author.display_name}**\n{TIME} Expiry Time: {expiry_text}\n{BOOST} Timestamp: {expiry_timestamp}",
|
||||||
color=0xFF0000,
|
color=0xFF0000,
|
||||||
)
|
)
|
||||||
embed.set_author(
|
embed.set_author(
|
||||||
@@ -171,7 +171,7 @@ class NoPrefix(commands.Cog):
|
|||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
self.client = client
|
self.client = client
|
||||||
self.staff = set()
|
self.staff = set()
|
||||||
self.db_path = "db/np.db"
|
self.db_path = db_path("np.db")
|
||||||
self.client.loop.create_task(self.load_staff())
|
self.client.loop.create_task(self.load_staff())
|
||||||
self.client.loop.create_task(self.setup_database())
|
self.client.loop.create_task(self.setup_database())
|
||||||
self.expiry_check.start()
|
self.expiry_check.start()
|
||||||
@@ -278,7 +278,7 @@ class NoPrefix(commands.Cog):
|
|||||||
support = Button(
|
support = Button(
|
||||||
label="Support",
|
label="Support",
|
||||||
style=discord.ButtonStyle.link,
|
style=discord.ButtonStyle.link,
|
||||||
url=f"https://discord.gg/codexdev",
|
url=f"https://discord.gg/hexahost",
|
||||||
)
|
)
|
||||||
view = View()
|
view = View()
|
||||||
view.add_item(support)
|
view.add_item(support)
|
||||||
@@ -363,7 +363,7 @@ class NoPrefix(commands.Cog):
|
|||||||
@_np.command(name="remove", help="Remove user from no-prefix")
|
@_np.command(name="remove", help="Remove user from no-prefix")
|
||||||
@commands.check(is_owner_or_staff)
|
@commands.check(is_owner_or_staff)
|
||||||
async def np_remove(self, ctx, user: discord.User):
|
async def np_remove(self, ctx, user: discord.User):
|
||||||
async with aiosqlite.connect("db/np.db") as db:
|
async with aiosqlite.connect(db_path("np.db")) as db:
|
||||||
async with db.execute(
|
async with db.execute(
|
||||||
"SELECT id FROM np WHERE id = ?", (user.id,)
|
"SELECT id FROM np WHERE id = ?", (user.id,)
|
||||||
) as cursor:
|
) as cursor:
|
||||||
@@ -423,7 +423,7 @@ class NoPrefix(commands.Cog):
|
|||||||
)
|
)
|
||||||
@commands.check(is_owner_or_staff)
|
@commands.check(is_owner_or_staff)
|
||||||
async def np_status(self, ctx, user: discord.User):
|
async def np_status(self, ctx, user: discord.User):
|
||||||
async with aiosqlite.connect("db/np.db") as db:
|
async with aiosqlite.connect(db_path("np.db")) as db:
|
||||||
async with db.execute(
|
async with db.execute(
|
||||||
"SELECT id, expiry_time FROM np WHERE id = ?", (user.id,)
|
"SELECT id, expiry_time FROM np WHERE id = ?", (user.id,)
|
||||||
) as cursor:
|
) as cursor:
|
||||||
@@ -581,7 +581,7 @@ class NoPrefix(commands.Cog):
|
|||||||
|
|
||||||
embed = CV2Embed(
|
embed = CV2Embed(
|
||||||
title="Congratulations you got 2 months No Prefix!",
|
title="Congratulations you got 2 months No Prefix!",
|
||||||
description=f"You've been credited 2 months of global No Prefix for boosting our Partnered Servers. You can now use my commands without prefix. If you wish to remove it, please reach out [Support Server](https://discord.gg/codexdev).",
|
description=f"You've been credited 2 months of global No Prefix for boosting our Partnered Servers. You can now use my commands without prefix. If you wish to remove it, please reach out [Support Server](https://discord.gg/hexahost).",
|
||||||
color=0xFF0000,
|
color=0xFF0000,
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
@@ -613,7 +613,7 @@ class NoPrefix(commands.Cog):
|
|||||||
|
|
||||||
embed = CV2Embed(
|
embed = CV2Embed(
|
||||||
title=f"{ICONS_WARNING} Global No Prefix Expired",
|
title=f"{ICONS_WARNING} Global No Prefix Expired",
|
||||||
description=f"Hey {user.mention}, your global no prefix has expired!\n\n__**Reason:**__ Unboosting our partnered Server.\nIf you think this is a mistake then please reach out [Support Server](https://discord.gg/codexdev).",
|
description=f"Hey {user.mention}, your global no prefix has expired!\n\n__**Reason:**__ Unboosting our partnered Server.\nIf you think this is a mistake then please reach out [Support Server](https://discord.gg/hexahost).",
|
||||||
color=0xFF0000,
|
color=0xFF0000,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user