dc-securex 1.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SecureX Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ include SDK_COMPLETE.md
4
+ recursive-include securex *.py
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: dc-securex
3
+ Version: 1.3.1
4
+ Summary: Backend-only Discord anti-nuke protection SDK
5
+ Home-page: https://github.com/yourusername/securex-antinuke-sdk
6
+ Author: SecureX Team
7
+ Author-email: SecureX Team <contact@securex.dev>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/yourusername/securex-antinuke-sdk
10
+ Project-URL: Repository, https://github.com/yourusername/securex-antinuke-sdk
11
+ Project-URL: Issues, https://github.com/yourusername/securex-antinuke-sdk/issues
12
+ Keywords: discord,bot,antinuke,security,protection,sdk
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Requires-Python: >=3.8
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: discord.py>=2.0.0
23
+ Dynamic: author
24
+ Dynamic: home-page
25
+ Dynamic: license-file
26
+ Dynamic: requires-python
27
+
28
+ # SecureX Anti-Nuke SDK
29
+
30
+ **Backend-only Discord anti-nuke protection.** You provide the UI, we provide the security logic.
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install securex-antinuke
36
+ ```
37
+
38
+ ## Quick Start
39
+
40
+ ```python
41
+ import discord
42
+ from discord.ext import commands
43
+ from securex import SecureX
44
+
45
+ bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())
46
+ sx = SecureX(bot)
47
+
48
+ # Enable protection
49
+ await sx.enable(whitelist=[123456789])
50
+
51
+ # Register callback - you build your own UI!
52
+ @sx.on_threat_detected
53
+ async def alert(threat):
54
+ # threat.type, threat.actor_id, threat.prevented, etc.
55
+ await channel.send(f"⚠️ Threat: {threat.type}")
56
+
57
+ bot.run("TOKEN")
58
+ ```
59
+
60
+ ## Features
61
+
62
+ ✅ **Channel Protection** - Detects & restores unauthorized channel changes
63
+ ✅ **Role Protection** - Detects & restores unauthorized role changes
64
+ ✅ **Member Protection** - Blocks unauthorized bots, bans, kicks
65
+ ✅ **Webhook Protection** - Removes spam webhooks
66
+ ✅ **Auto-Backup** - Automatic server backups
67
+ ✅ **Whitelist System** - Manage authorized users
68
+ ✅ **Role Position Monitoring** - 5-second checks with bulk restore (NEW in v1.2!)
69
+ ❌ **No UI** - You decide how to present data!
70
+
71
+ ## Data Objects
72
+
73
+ All callbacks receive **pure data objects** (no Discord embeds):
74
+
75
+ ### ThreatEvent
76
+ ```python
77
+ @dataclass
78
+ class ThreatEvent:
79
+ type: str # "channel_delete", "role_create", etc.
80
+ guild_id: int
81
+ actor_id: int # Who did it
82
+ target_id: int # What was affected
83
+ target_name: str
84
+ prevented: bool # Was it stopped?
85
+ restored: bool # Was it restored?
86
+ timestamp: datetime
87
+ details: dict # Additional context
88
+ ```
89
+
90
+ ## Examples
91
+
92
+ ### Custom Embed UI
93
+ ```python
94
+ @sx.on_threat_detected
95
+ async def custom_alert(threat):
96
+ embed = discord.Embed(
97
+ title="🚨 Security Alert",
98
+ description=f"Detected: {threat.type}"
99
+ )
100
+ embed.add_field(name="User", value=f"<@{threat.actor_id}>")
101
+ await log_channel.send(embed=embed)
102
+ ```
103
+
104
+ ### Webhook Integration
105
+ ```python
106
+ @sx.on_threat_detected
107
+ async def send_webhook(threat):
108
+ await webhook.send(threat.to_json())
109
+ ```
110
+
111
+ ### Multi-Output
112
+ ```python
113
+ @sx.on_threat_detected
114
+ async def handle(threat):
115
+ # Send to Discord
116
+ await channel.send(f"Threat: {threat.type}")
117
+
118
+ # Log to database
119
+ await db.insert(threat.to_dict())
120
+
121
+ # Send to external API
122
+ await api.post("/alerts", threat.to_json())
123
+ ```
124
+
125
+ ## API Reference
126
+
127
+ ### Main Client
128
+
129
+ ```python
130
+ sx = SecureX(bot, backup_dir=Path("./backups"))
131
+ ```
132
+
133
+ ### Methods
134
+
135
+ ```python
136
+ await sx.enable(whitelist=[...], auto_backup=True, role_position_monitoring=True)
137
+ await sx.create_backup(guild_id)
138
+ await sx.get_recent_threats(guild_id, limit=10)
139
+ ```
140
+
141
+ ### Whitelist
142
+
143
+ ```python
144
+ await sx.whitelist.add(guild_id, user_id)
145
+ await sx.whitelist.remove(guild_id, user_id)
146
+ users = await sx.whitelist.get_all(guild_id)
147
+ ```
148
+
149
+ ### Callbacks
150
+
151
+ ```python
152
+ @sx.on_threat_detected # ThreatEvent
153
+ @sx.on_backup_completed # BackupInfo
154
+ @sx.on_restore_completed # RestoreResult
155
+ @sx.on_whitelist_changed # WhitelistChange
156
+ ```
157
+
158
+ ## Why SDK?
159
+
160
+ - 🎨 **Full UI Control** - Design your own embeds, dashboards, webhooks
161
+ - 📦 **Easy Integration** - Just `pip install` and import
162
+ - 🔒 **Battle-Tested Logic** - Proven anti-nuke protection
163
+ - 🚀 **No Boilerplate** - We handle the complex stuff
164
+ - 💰 **Reusable** - Use across multiple projects
165
+
166
+ ## License
167
+
168
+ MIT License - see LICENSE file
169
+
170
+ ## Support
171
+
172
+ - GitHub: [github.com/yourusername/securex-antinuke](https://github.com/yourusername/securex-antinuke)
173
+ - Issues: [Report a bug](https://github.com/yourusername/securex-antinuke/issues)
174
+
175
+ ---
176
+
177
+ Made with ❤️ by SecureX Team
@@ -0,0 +1,150 @@
1
+ # SecureX Anti-Nuke SDK
2
+
3
+ **Backend-only Discord anti-nuke protection.** You provide the UI, we provide the security logic.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install securex-antinuke
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ import discord
15
+ from discord.ext import commands
16
+ from securex import SecureX
17
+
18
+ bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())
19
+ sx = SecureX(bot)
20
+
21
+ # Enable protection
22
+ await sx.enable(whitelist=[123456789])
23
+
24
+ # Register callback - you build your own UI!
25
+ @sx.on_threat_detected
26
+ async def alert(threat):
27
+ # threat.type, threat.actor_id, threat.prevented, etc.
28
+ await channel.send(f"⚠️ Threat: {threat.type}")
29
+
30
+ bot.run("TOKEN")
31
+ ```
32
+
33
+ ## Features
34
+
35
+ ✅ **Channel Protection** - Detects & restores unauthorized channel changes
36
+ ✅ **Role Protection** - Detects & restores unauthorized role changes
37
+ ✅ **Member Protection** - Blocks unauthorized bots, bans, kicks
38
+ ✅ **Webhook Protection** - Removes spam webhooks
39
+ ✅ **Auto-Backup** - Automatic server backups
40
+ ✅ **Whitelist System** - Manage authorized users
41
+ ✅ **Role Position Monitoring** - 5-second checks with bulk restore (NEW in v1.2!)
42
+ ❌ **No UI** - You decide how to present data!
43
+
44
+ ## Data Objects
45
+
46
+ All callbacks receive **pure data objects** (no Discord embeds):
47
+
48
+ ### ThreatEvent
49
+ ```python
50
+ @dataclass
51
+ class ThreatEvent:
52
+ type: str # "channel_delete", "role_create", etc.
53
+ guild_id: int
54
+ actor_id: int # Who did it
55
+ target_id: int # What was affected
56
+ target_name: str
57
+ prevented: bool # Was it stopped?
58
+ restored: bool # Was it restored?
59
+ timestamp: datetime
60
+ details: dict # Additional context
61
+ ```
62
+
63
+ ## Examples
64
+
65
+ ### Custom Embed UI
66
+ ```python
67
+ @sx.on_threat_detected
68
+ async def custom_alert(threat):
69
+ embed = discord.Embed(
70
+ title="🚨 Security Alert",
71
+ description=f"Detected: {threat.type}"
72
+ )
73
+ embed.add_field(name="User", value=f"<@{threat.actor_id}>")
74
+ await log_channel.send(embed=embed)
75
+ ```
76
+
77
+ ### Webhook Integration
78
+ ```python
79
+ @sx.on_threat_detected
80
+ async def send_webhook(threat):
81
+ await webhook.send(threat.to_json())
82
+ ```
83
+
84
+ ### Multi-Output
85
+ ```python
86
+ @sx.on_threat_detected
87
+ async def handle(threat):
88
+ # Send to Discord
89
+ await channel.send(f"Threat: {threat.type}")
90
+
91
+ # Log to database
92
+ await db.insert(threat.to_dict())
93
+
94
+ # Send to external API
95
+ await api.post("/alerts", threat.to_json())
96
+ ```
97
+
98
+ ## API Reference
99
+
100
+ ### Main Client
101
+
102
+ ```python
103
+ sx = SecureX(bot, backup_dir=Path("./backups"))
104
+ ```
105
+
106
+ ### Methods
107
+
108
+ ```python
109
+ await sx.enable(whitelist=[...], auto_backup=True, role_position_monitoring=True)
110
+ await sx.create_backup(guild_id)
111
+ await sx.get_recent_threats(guild_id, limit=10)
112
+ ```
113
+
114
+ ### Whitelist
115
+
116
+ ```python
117
+ await sx.whitelist.add(guild_id, user_id)
118
+ await sx.whitelist.remove(guild_id, user_id)
119
+ users = await sx.whitelist.get_all(guild_id)
120
+ ```
121
+
122
+ ### Callbacks
123
+
124
+ ```python
125
+ @sx.on_threat_detected # ThreatEvent
126
+ @sx.on_backup_completed # BackupInfo
127
+ @sx.on_restore_completed # RestoreResult
128
+ @sx.on_whitelist_changed # WhitelistChange
129
+ ```
130
+
131
+ ## Why SDK?
132
+
133
+ - 🎨 **Full UI Control** - Design your own embeds, dashboards, webhooks
134
+ - 📦 **Easy Integration** - Just `pip install` and import
135
+ - 🔒 **Battle-Tested Logic** - Proven anti-nuke protection
136
+ - 🚀 **No Boilerplate** - We handle the complex stuff
137
+ - 💰 **Reusable** - Use across multiple projects
138
+
139
+ ## License
140
+
141
+ MIT License - see LICENSE file
142
+
143
+ ## Support
144
+
145
+ - GitHub: [github.com/yourusername/securex-antinuke](https://github.com/yourusername/securex-antinuke)
146
+ - Issues: [Report a bug](https://github.com/yourusername/securex-antinuke/issues)
147
+
148
+ ---
149
+
150
+ Made with ❤️ by SecureX Team
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: dc-securex
3
+ Version: 1.3.1
4
+ Summary: Backend-only Discord anti-nuke protection SDK
5
+ Home-page: https://github.com/yourusername/securex-antinuke-sdk
6
+ Author: SecureX Team
7
+ Author-email: SecureX Team <contact@securex.dev>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/yourusername/securex-antinuke-sdk
10
+ Project-URL: Repository, https://github.com/yourusername/securex-antinuke-sdk
11
+ Project-URL: Issues, https://github.com/yourusername/securex-antinuke-sdk/issues
12
+ Keywords: discord,bot,antinuke,security,protection,sdk
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Requires-Python: >=3.8
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: discord.py>=2.0.0
23
+ Dynamic: author
24
+ Dynamic: home-page
25
+ Dynamic: license-file
26
+ Dynamic: requires-python
27
+
28
+ # SecureX Anti-Nuke SDK
29
+
30
+ **Backend-only Discord anti-nuke protection.** You provide the UI, we provide the security logic.
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install securex-antinuke
36
+ ```
37
+
38
+ ## Quick Start
39
+
40
+ ```python
41
+ import discord
42
+ from discord.ext import commands
43
+ from securex import SecureX
44
+
45
+ bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())
46
+ sx = SecureX(bot)
47
+
48
+ # Enable protection
49
+ await sx.enable(whitelist=[123456789])
50
+
51
+ # Register callback - you build your own UI!
52
+ @sx.on_threat_detected
53
+ async def alert(threat):
54
+ # threat.type, threat.actor_id, threat.prevented, etc.
55
+ await channel.send(f"⚠️ Threat: {threat.type}")
56
+
57
+ bot.run("TOKEN")
58
+ ```
59
+
60
+ ## Features
61
+
62
+ ✅ **Channel Protection** - Detects & restores unauthorized channel changes
63
+ ✅ **Role Protection** - Detects & restores unauthorized role changes
64
+ ✅ **Member Protection** - Blocks unauthorized bots, bans, kicks
65
+ ✅ **Webhook Protection** - Removes spam webhooks
66
+ ✅ **Auto-Backup** - Automatic server backups
67
+ ✅ **Whitelist System** - Manage authorized users
68
+ ✅ **Role Position Monitoring** - 5-second checks with bulk restore (NEW in v1.2!)
69
+ ❌ **No UI** - You decide how to present data!
70
+
71
+ ## Data Objects
72
+
73
+ All callbacks receive **pure data objects** (no Discord embeds):
74
+
75
+ ### ThreatEvent
76
+ ```python
77
+ @dataclass
78
+ class ThreatEvent:
79
+ type: str # "channel_delete", "role_create", etc.
80
+ guild_id: int
81
+ actor_id: int # Who did it
82
+ target_id: int # What was affected
83
+ target_name: str
84
+ prevented: bool # Was it stopped?
85
+ restored: bool # Was it restored?
86
+ timestamp: datetime
87
+ details: dict # Additional context
88
+ ```
89
+
90
+ ## Examples
91
+
92
+ ### Custom Embed UI
93
+ ```python
94
+ @sx.on_threat_detected
95
+ async def custom_alert(threat):
96
+ embed = discord.Embed(
97
+ title="🚨 Security Alert",
98
+ description=f"Detected: {threat.type}"
99
+ )
100
+ embed.add_field(name="User", value=f"<@{threat.actor_id}>")
101
+ await log_channel.send(embed=embed)
102
+ ```
103
+
104
+ ### Webhook Integration
105
+ ```python
106
+ @sx.on_threat_detected
107
+ async def send_webhook(threat):
108
+ await webhook.send(threat.to_json())
109
+ ```
110
+
111
+ ### Multi-Output
112
+ ```python
113
+ @sx.on_threat_detected
114
+ async def handle(threat):
115
+ # Send to Discord
116
+ await channel.send(f"Threat: {threat.type}")
117
+
118
+ # Log to database
119
+ await db.insert(threat.to_dict())
120
+
121
+ # Send to external API
122
+ await api.post("/alerts", threat.to_json())
123
+ ```
124
+
125
+ ## API Reference
126
+
127
+ ### Main Client
128
+
129
+ ```python
130
+ sx = SecureX(bot, backup_dir=Path("./backups"))
131
+ ```
132
+
133
+ ### Methods
134
+
135
+ ```python
136
+ await sx.enable(whitelist=[...], auto_backup=True, role_position_monitoring=True)
137
+ await sx.create_backup(guild_id)
138
+ await sx.get_recent_threats(guild_id, limit=10)
139
+ ```
140
+
141
+ ### Whitelist
142
+
143
+ ```python
144
+ await sx.whitelist.add(guild_id, user_id)
145
+ await sx.whitelist.remove(guild_id, user_id)
146
+ users = await sx.whitelist.get_all(guild_id)
147
+ ```
148
+
149
+ ### Callbacks
150
+
151
+ ```python
152
+ @sx.on_threat_detected # ThreatEvent
153
+ @sx.on_backup_completed # BackupInfo
154
+ @sx.on_restore_completed # RestoreResult
155
+ @sx.on_whitelist_changed # WhitelistChange
156
+ ```
157
+
158
+ ## Why SDK?
159
+
160
+ - 🎨 **Full UI Control** - Design your own embeds, dashboards, webhooks
161
+ - 📦 **Easy Integration** - Just `pip install` and import
162
+ - 🔒 **Battle-Tested Logic** - Proven anti-nuke protection
163
+ - 🚀 **No Boilerplate** - We handle the complex stuff
164
+ - 💰 **Reusable** - Use across multiple projects
165
+
166
+ ## License
167
+
168
+ MIT License - see LICENSE file
169
+
170
+ ## Support
171
+
172
+ - GitHub: [github.com/yourusername/securex-antinuke](https://github.com/yourusername/securex-antinuke)
173
+ - Issues: [Report a bug](https://github.com/yourusername/securex-antinuke/issues)
174
+
175
+ ---
176
+
177
+ Made with ❤️ by SecureX Team
@@ -0,0 +1,23 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ setup.py
6
+ dc_securex.egg-info/PKG-INFO
7
+ dc_securex.egg-info/SOURCES.txt
8
+ dc_securex.egg-info/dependency_links.txt
9
+ dc_securex.egg-info/requires.txt
10
+ dc_securex.egg-info/top_level.txt
11
+ securex/__init__.py
12
+ securex/client.py
13
+ securex/models.py
14
+ securex/backup/__init__.py
15
+ securex/backup/manager.py
16
+ securex/handlers/__init__.py
17
+ securex/handlers/channel.py
18
+ securex/handlers/member.py
19
+ securex/handlers/role.py
20
+ securex/handlers/role_monitor.py
21
+ securex/handlers/webhook.py
22
+ securex/utils/__init__.py
23
+ securex/utils/whitelist.py
@@ -0,0 +1 @@
1
+ discord.py>=2.0.0
@@ -0,0 +1 @@
1
+ securex
@@ -0,0 +1,31 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "dc-securex"
7
+ version = "1.3.1"
8
+ description = "Backend-only Discord anti-nuke protection SDK"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = {text = "MIT"}
12
+ keywords = ["discord", "bot", "antinuke", "security", "protection", "sdk"]
13
+ authors = [
14
+ {name = "SecureX Team", email = "contact@securex.dev"}
15
+ ]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "Topic :: Software Development :: Libraries :: Python Modules",
20
+ "Programming Language :: Python :: 3",
21
+ "License :: OSI Approved :: MIT License",
22
+ "Operating System :: OS Independent",
23
+ ]
24
+ dependencies = [
25
+ "discord.py>=2.0.0",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/yourusername/securex-antinuke-sdk"
30
+ Repository = "https://github.com/yourusername/securex-antinuke-sdk"
31
+ Issues = "https://github.com/yourusername/securex-antinuke-sdk/issues"
@@ -0,0 +1,18 @@
1
+ """
2
+ SecureX Anti-Nuke SDK
3
+ Backend-only Discord anti-nuke protection.
4
+ Developers provide their own UI.
5
+ """
6
+
7
+ __version__ = "1.0.0"
8
+ __author__ = "SecureX Team"
9
+
10
+ from .client import SecureX
11
+ from .models import ThreatEvent, BackupInfo, RestoreResult
12
+
13
+ __all__ = [
14
+ "SecureX",
15
+ "ThreatEvent",
16
+ "BackupInfo",
17
+ "RestoreResult",
18
+ ]
@@ -0,0 +1,5 @@
1
+ """Backup package"""
2
+
3
+ from .manager import BackupManager
4
+
5
+ __all__ = ['BackupManager']