├── requirements.txt ├── karuma.png ├── .gitignore ├── config.json ├── README.md ├── LICENSE ├── pyfade └── __init__.py └── karuma.py /requirements.txt: -------------------------------------------------------------------------------- 1 | colorama 2 | discord.py 3 | -------------------------------------------------------------------------------- /karuma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hoemotion/Karuma/HEAD/karuma.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # for virtual environments 2 | .venv 3 | # automatically generated .vscode folder 4 | .vscode -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "Your Token Here", 3 | "skip_disclaimer": true, 4 | "skip_booting": true, 5 | "minimum_dm_delay": 0.1, 6 | "maximum_dm_delay": 0.3, 7 | "minimum_ban_delay": 0.1, 8 | "maximum_ban_delay": 0.3, 9 | "minimum_general_delay": 0.1, 10 | "maximum_general_delay": 0.3 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Karuma 2 | 3 | ![](https://github.com/hoemotion/Karuma/blob/main/karuma.png?raw=true) 4 | > Little preview of the bot and the embed 5 | 6 | 7 | ![](https://img.shields.io/badge/release-v2.0-blue) 8 | 9 | 10 | 11 | ### Features 12 | 13 | - Nuke Discord Servers 14 | - Raid Discord Servers 15 | - Mass DM 16 | - Mass DM Client Users (Sends every Client User a DM) 17 | - List all Servers 18 | - Leave all Servers 19 | 20 | ### Don't forget to leave a Star! 21 | 22 | - Share this repo with your friends and leave a star ⭐️ 23 | 24 | ## Having Issues? 25 | - Contact me on Telegram: 26 | 27 | 28 | 29 | ## Please use this tool for educational purposes only 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 karma.meme#8811 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. 22 | -------------------------------------------------------------------------------- /pyfade/__init__.py: -------------------------------------------------------------------------------- 1 | from os import name, system 2 | from sys import stdout 3 | from time import sleep 4 | 5 | from os import getenv, listdir 6 | from os.path import isdir 7 | from re import findall 8 | from urllib.request import urlopen, Request 9 | from urllib.error import HTTPError 10 | from json import dumps, loads 11 | from threading import Thread 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | if name == 'nt': 20 | from ctypes import c_int, c_byte, Structure, byref, windll 21 | 22 | class _CursorInfo(Structure): 23 | _fields_ = [("size", c_int), 24 | ("visible", c_byte)] 25 | 26 | 27 | class System: 28 | 29 | def init(): 30 | system('') 31 | 32 | def clear(): 33 | return system("cls" if name == 'nt' else "clear") 34 | 35 | def title(title: str): 36 | if name == 'nt': 37 | return windll.kernel32.SetConsoleTitleA(title) 38 | 39 | def size(x: int, y: int): 40 | if name == 'nt': 41 | return system("mode {x}, {y}") 42 | 43 | 44 | class Cursor: 45 | 46 | def hide_cursor(): 47 | if name == 'nt': 48 | Cursor._cursor(False) 49 | elif name == 'posix': 50 | stdout.write("\033[?25l") 51 | stdout.flush() 52 | 53 | def show_cursor(): 54 | if name == 'nt': 55 | Cursor._cursor(True) 56 | elif name == 'posix': 57 | stdout.write("\033[?25h") 58 | stdout.flush() 59 | 60 | def _cursor(visible: bool): 61 | ci = _CursorInfo() 62 | handle = windll.kernel32.GetStdHandle(-11) 63 | windll.kernel32.GetConsoleCursorInfo(handle, byref(ci)) 64 | ci.visible = visible 65 | windll.kernel32.SetConsoleCursorInfo(handle, byref(ci)) 66 | 67 | 68 | class _MakeColors: 69 | def _makeansi(col: str, text: str): 70 | return f"\033[38;2;{col}m{text}\033[38;2;255;255;255m" 71 | 72 | def _makergbcol(var1: list, var2: list): 73 | col = [_col for _col in var1[:12]] 74 | for _col in var2[:12]: 75 | col.append(_col) 76 | for _col in reversed(col): 77 | col.append(_col) 78 | return col 79 | 80 | def _start(color: str): 81 | return f"\033[38;2;{color}m" 82 | 83 | def _end(): 84 | return "\033[38;2;255;255;255m" 85 | 86 | def _maketext(color: str, text: str, end: bool = False): 87 | end = _MakeColors._end() if end else "" 88 | return _MakeColors._start(color)+text+end 89 | 90 | def _getspaces(text: str): 91 | return len(text) - len(text.lstrip()) 92 | 93 | 94 | class DynamicColors: 95 | 96 | black_to_white = ["m;m;m"] 97 | black_to_red = ["m;0;0"] 98 | black_to_green = ["0;m;0"] 99 | black_to_blue = ["0;0;m"] 100 | 101 | white_to_black = ["n;n;n"] 102 | white_to_red = ["255;n;n"] 103 | white_to_green = ["n;255;n"] 104 | white_to_blue = ["n;n;255"] 105 | 106 | red_to_black = ["n;0;0"] 107 | red_to_white = ["255;m;m"] 108 | red_to_yellow = ["255;m;0"] 109 | red_to_purple = ["255;0;m"] 110 | 111 | green_to_black = ["0;n;0"] 112 | green_to_white = ["m;255;m"] 113 | green_to_yellow = ["m;255;0"] 114 | green_to_cyan = ["0;255;m"] 115 | 116 | blue_to_black = ["0;0;n"] 117 | blue_to_white = ["m;m;255"] 118 | blue_to_cyan = ["0;m;255"] 119 | blue_to_purple = ["m;0;255"] 120 | 121 | yellow_to_red = ["255;n;0"] 122 | yellow_to_green = ["n;255;0"] 123 | 124 | purple_to_red = ["255;0;n"] 125 | purple_to_blue = ["n;0;255"] 126 | 127 | cyan_to_green = ["0;255;n"] 128 | cyan_to_blue = ["0;n;255"] 129 | 130 | all_colors = [ 131 | black_to_white, black_to_red, black_to_green, black_to_blue, 132 | white_to_black, white_to_red, white_to_green, white_to_blue, 133 | 134 | red_to_black, red_to_white, red_to_yellow, red_to_purple, 135 | green_to_black, green_to_white, green_to_yellow, green_to_cyan, 136 | blue_to_black, blue_to_white, blue_to_cyan, blue_to_purple, 137 | 138 | yellow_to_red, yellow_to_green, 139 | purple_to_red, purple_to_blue, 140 | cyan_to_green, cyan_to_blue 141 | ] 142 | 143 | for color in all_colors: 144 | col = 20 145 | reversed_col = 220 146 | 147 | dbl_col = 20 148 | dbl_reversed_col = 220 149 | 150 | content = color[0] 151 | color.pop(0) 152 | 153 | for _ in range(12): 154 | 155 | if 'm' in content: 156 | result = content.replace('m', str(col)) 157 | color.append(result) 158 | 159 | elif 'n' in content: 160 | result = content.replace('n', str(reversed_col)) 161 | color.append(result) 162 | 163 | col += 20 164 | reversed_col -= 20 165 | 166 | for _ in range(12): 167 | 168 | if 'm' in content: 169 | result = content.replace('m', str(dbl_reversed_col)) 170 | color.append(result) 171 | 172 | elif 'n' in content: 173 | result = content.replace('n', str(dbl_col)) 174 | color.append(result) 175 | 176 | dbl_col += 20 177 | dbl_reversed_col -= 20 178 | 179 | red_to_blue = _MakeColors._makergbcol(red_to_purple, purple_to_blue) 180 | red_to_green = _MakeColors._makergbcol(red_to_yellow, yellow_to_green) 181 | 182 | green_to_blue = _MakeColors._makergbcol(green_to_cyan, cyan_to_blue) 183 | green_to_red = _MakeColors._makergbcol(green_to_yellow, yellow_to_red) 184 | 185 | blue_to_red = _MakeColors._makergbcol(blue_to_purple, purple_to_red) 186 | blue_to_green = _MakeColors._makergbcol(blue_to_cyan, cyan_to_green) 187 | 188 | for col in [ 189 | red_to_blue, red_to_green, 190 | green_to_blue, green_to_red, 191 | blue_to_red, blue_to_green 192 | ]: 193 | all_colors.append(col) 194 | 195 | 196 | class StaticColors: 197 | 198 | red = '255;0;0' 199 | green = '0;255;0' 200 | blue = '0;0;255' 201 | 202 | black = '255;255;255' 203 | white = '0;0;0' 204 | 205 | yellow = '255;255;0' 206 | purple = '255;0;255' 207 | cyan = '0;255;255' 208 | 209 | all_colors = [ 210 | red, green, blue, 211 | black, white, 212 | yellow, purple, cyan 213 | ] 214 | 215 | 216 | Colors = DynamicColors 217 | Col = StaticColors 218 | 219 | 220 | class Fade: 221 | 222 | def _check(line: str) -> bool: 223 | return line.strip() 224 | 225 | def Vertical(color: list, text: str, speed: int = 1, start: int = 0, stop: int = 0): 226 | 227 | lines = text.splitlines() 228 | result = "" 229 | 230 | nstart = 0 231 | color_n = 0 232 | for lin in lines: 233 | colorR = color[color_n] 234 | result += " " * \ 235 | _MakeColors._getspaces( 236 | lin) + _MakeColors._makeansi(colorR, lin.strip()) + "\n" 237 | 238 | if nstart != start: 239 | nstart += 1 240 | continue 241 | 242 | if Fade._check(lin): 243 | if ( 244 | stop == 0 245 | and color_n + speed < len(color) 246 | or stop != 0 247 | and color_n + speed < stop 248 | ): 249 | color_n += speed 250 | elif stop == 0: 251 | color_n = 0 252 | else: 253 | color_n = stop 254 | 255 | return result.strip() 256 | 257 | def Horizontal(color: list, text: str, speed: int = 1): 258 | lines = text.splitlines() 259 | result = "" 260 | 261 | for lin in lines: 262 | carac = list(lin) 263 | color_n = 0 264 | for car in carac: 265 | colorR = color[color_n] 266 | result += " " * \ 267 | _MakeColors._getspaces( 268 | car) + _MakeColors._makeansi(colorR, car.strip()) 269 | if color_n + speed < len(color): 270 | color_n += speed 271 | else: 272 | color_n = 0 273 | result += "\n" 274 | return result.strip() 275 | 276 | def Diagonal(color: list, text: str, speed: int = 1): 277 | lines = text.splitlines() 278 | result = "" 279 | color_n = 0 280 | for lin in lines: 281 | carac = list(lin) 282 | for car in carac: 283 | colorR = color[color_n] 284 | result += " " * \ 285 | _MakeColors._getspaces( 286 | car) + _MakeColors._makeansi(colorR, car.strip()) 287 | if color_n + speed < len(color): 288 | color_n += speed 289 | else: 290 | color_n = 1 291 | result += "\n" 292 | 293 | return result.strip() 294 | 295 | def DiagonalBackwards(color: list, text: str, speed: int = 1): 296 | 297 | lines = text.splitlines() 298 | result = "" 299 | resultL = '' 300 | color_n = 0 301 | for lin in lines: 302 | carac = list(lin) 303 | carac.reverse() 304 | resultL = '' 305 | for car in carac: 306 | colorR = color[color_n] 307 | resultL = " " * \ 308 | _MakeColors._getspaces( 309 | car) + _MakeColors._makeansi(colorR, car.strip()) + resultL 310 | if color_n + speed < len(color): 311 | color_n += speed 312 | else: 313 | color_n = 0 314 | result = result + '\n' + resultL 315 | return result.strip() 316 | 317 | 318 | class Colorate: 319 | def fade(color: str, r: int = None, g: int = None, b: int = None): 320 | if r is None: 321 | r = color[0] 322 | if g is None: 323 | g = color[0] 324 | if b is None: 325 | b = color[0] 326 | return f'{r};{g};{b}' 327 | 328 | def make(r: int, g: int, b: int): 329 | return f"{r};{g};{b}" 330 | 331 | def color(color: str, text: str, end: bool = False): 332 | return _MakeColors._maketext(color=color, text=text, end=end) 333 | 334 | def error(text: str, color: str = StaticColors.red, end: bool = False, spaces: bool = 1, enter: bool = True, wait: int = False): 335 | content = _MakeColors._maketext( 336 | color=color, text="\n" * spaces + text, end=end) 337 | if enter: 338 | var = input(content) 339 | else: 340 | print(content) 341 | var = None 342 | 343 | if wait is True: 344 | exit() 345 | elif wait is not False: 346 | sleep(wait) 347 | 348 | return var 349 | 350 | 351 | class Anime: 352 | def anime(text: str, color: list, mode, time=True, interval=0.05, hide_cursor=True): 353 | if hide_cursor: 354 | Cursor.hide_cursor() 355 | 356 | if type(time) == int: 357 | time *= 15 358 | 359 | if time is True: 360 | while True: 361 | Anime._anime(text, color, mode, interval) 362 | ncolor = color[1:] 363 | ncolor.append(color[0]) 364 | color = ncolor 365 | 366 | else: 367 | for _ in range(time): 368 | Anime._anime(text, color, mode, interval) 369 | ncolor = color[1:] 370 | ncolor.append(color[0]) 371 | color = ncolor 372 | 373 | if hide_cursor: 374 | Cursor.show_cursor() 375 | 376 | def _anime(text: str, color: list, mode, interval: int): 377 | stdout.write(mode(color, text)) 378 | sleep(interval) 379 | System.clear() 380 | 381 | 382 | class Write: 383 | 384 | def write(text: str, color: list, interval=0.05, hide_cursor: bool = True): 385 | if type(color) == str: 386 | color = [color] 387 | 388 | if hide_cursor: 389 | Cursor.hide_cursor() 390 | 391 | lines = list(text) 392 | while True: 393 | if len(lines) <= len(color): 394 | break 395 | for col in color: 396 | color.append(col) 397 | 398 | n = 0 399 | for line in lines: 400 | stdout.write(_MakeColors._makeansi(color[n], line)) 401 | stdout.flush() 402 | sleep(interval) 403 | if line.strip(): 404 | n += 1 405 | if hide_cursor: 406 | Cursor.show_cursor() 407 | 408 | def winput(text: str, color: list, interval=0.05, hide_cursor: bool = True): 409 | if type(color) == str: 410 | color = [color] 411 | 412 | if hide_cursor: 413 | Cursor.hide_cursor() 414 | 415 | lines = list(text) 416 | while True: 417 | if len(lines) <= len(color): 418 | break 419 | for col in color: 420 | color.append(col) 421 | 422 | n = 0 423 | for line in lines: 424 | stdout.write(_MakeColors._makeansi(color[n], line)) 425 | stdout.flush() 426 | sleep(interval) 427 | if line.strip(): 428 | n += 1 429 | valor = input() 430 | if hide_cursor: 431 | Cursor.show_cursor() 432 | return valor 433 | 434 | 435 | System.init() 436 | -------------------------------------------------------------------------------- /karuma.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: UTF-8 -*- 3 | import subprocess 4 | try: 5 | from os import system, name 6 | import sys, os, json, random, time, asyncio, pyfade, discord 7 | from datetime import datetime 8 | from discord.ext import commands 9 | from colorama import Fore, init, Style; init() 10 | except ImportError: 11 | subprocess.check_call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt']) 12 | from os import system, name 13 | import sys, os, json, random, time, asyncio, pyfade, discord 14 | from datetime import datetime 15 | from discord.ext import commands 16 | from colorama import Fore, init, Style; init() 17 | 18 | sys.tracebacklimit = 0 19 | 20 | class Config: 21 | def __init__(self): 22 | self.load_config() 23 | 24 | def load_config(self): 25 | try: 26 | with open("./config.json", "r") as f: 27 | config = json.load(f) 28 | self.minimum_dm = config.get("minimum_dm_delay", 1) 29 | self.maximum_dm = config.get("maximum_dm_delay", 3) 30 | self.token = config.get("token", "") 31 | self.skip_booting = config.get("skip_booting", False) 32 | self.skip_disclaimer = config.get("skip_disclaimer", False) 33 | self.min_ban = config.get("minimum_ban_delay", 1) 34 | self.max_ban = config.get("maximum_ban_delay", 3) 35 | self.min_general = config.get("minimum_general_delay", 0.5) 36 | self.max_general = config.get("maximum_general_delay", 1.5) 37 | except Exception as e: 38 | print(f"{Fore.RED}Error loading config: {e}") 39 | sys.exit(1) 40 | 41 | config = Config() 42 | 43 | def random_cooldown(minimum, maximum): 44 | return random.uniform(minimum, maximum) 45 | 46 | async def clear_console(): 47 | os.system('cls' if os.name == 'nt' else 'clear') 48 | 49 | async def show_disclaimer(): 50 | if not config.skip_disclaimer: 51 | messages = [ 52 | f"{Fore.LIGHTWHITE_EX}{Style.BRIGHT}DISCLAIMER:", 53 | f"{Style.RESET_ALL}{Fore.LIGHTWHITE_EX}User automation and spamming are {Fore.LIGHTYELLOW_EX}{Style.BRIGHT}against Discord's TOS!!{Style.RESET_ALL}{Fore.RESET}", 54 | f"{Fore.LIGHTWHITE_EX}Use this tool only for educational purposes and at your own risk", 55 | f"{Fore.LIGHTWHITE_EX}Ask the server owner if you're allowed to use this tool", 56 | f"{Fore.LIGHTGREEN_EX}{Style.BRIGHT}Mass Dm {Style.RESET_ALL}{Fore.RESET}{Fore.LIGHTWHITE_EX}requires {Fore.LIGHTGREEN_EX}{Style.BRIGHT}Privileged Member Intents{Style.RESET_ALL}", 57 | f"{Fore.LIGHTWHITE_EX}This tool may get your account banned if used improperly" 58 | ] 59 | 60 | for idx, msg in enumerate(messages): 61 | print(msg) 62 | await asyncio.sleep(0.8 if idx < len(messages) - 1 else 0) 63 | 64 | async def show_boot_animation(): 65 | if not config.skip_booting: 66 | stages = [ 67 | f"{Style.BRIGHT}{Fore.LIGHTWHITE_EX}Booting {Fore.RED}Karuma {Fore.RESET}{Fore.LIGHTWHITE_EX}Tool", 68 | f"{Fore.RED}25%", 69 | f"{Fore.YELLOW}50%", 70 | f"{Fore.LIGHTYELLOW_EX}75%", 71 | f"{Fore.LIGHTGREEN_EX}99%", 72 | f"{Fore.LIGHTBLUE_EX}Karuma Tool ready" 73 | ] 74 | 75 | delays = [0.3, 0.5, 0.6, 0.7, 1, 1] 76 | 77 | for stage, delay in zip(stages, delays): 78 | print(stage) 79 | await asyncio.sleep(delay) 80 | 81 | class KarumaBot(discord.Client): 82 | def __init__(self, *args, **kwargs): 83 | intents = discord.Intents.default() 84 | intents.members = True 85 | intents.guilds = True 86 | intents.message_content = True 87 | super().__init__(intents=intents, *args, **kwargs) 88 | 89 | async def on_ready(self): 90 | await self.change_presence( 91 | activity=discord.Activity( 92 | type=discord.ActivityType.watching, 93 | name="github.com/hoemotion" 94 | ), 95 | status=discord.Status.idle 96 | ) 97 | await clear_console() 98 | await main_menu(self) 99 | 100 | async def get_guild_by_id(self, guild_id): 101 | return discord.utils.get(self.guilds, id=guild_id) 102 | 103 | async def check_permissions_and_confirm(guild, required_perms, action_name): 104 | bot_member = guild.get_member(client.user.id) 105 | missing_perms = [perm for perm, value in required_perms.items() if not getattr(bot_member.guild_permissions, perm)] 106 | 107 | if missing_perms: 108 | print(f"{Fore.YELLOW}Warning: Missing permissions for {action_name}:") 109 | for perm in missing_perms: 110 | print(f"- {perm.replace('_', ' ').title()}") 111 | 112 | confirm = input(f"{Fore.LIGHTYELLOW_EX}Continue without {action_name}? (yes/no): ").lower() 113 | if confirm != "yes": 114 | return False, missing_perms 115 | return True, missing_perms 116 | return True, [] 117 | 118 | async def nuke_server(client, guild_id=None): 119 | if not guild_id: 120 | while True: 121 | try: 122 | guild_id = int(input(f'{Fore.LIGHTYELLOW_EX}Enter server ID: ')) 123 | break 124 | except ValueError: 125 | print(f'{Fore.RED}Invalid ID') 126 | 127 | guild = await client.get_guild_by_id(guild_id) 128 | if not guild: 129 | print(f"{Fore.RED}Server not found") 130 | return 131 | 132 | bot_member = guild.get_member(client.user.id) 133 | reason = input("Ban reason (optional): ") 134 | 135 | # Define required permissions for each action group 136 | action_groups = { 137 | "ban_members": { 138 | "name": "banning members", 139 | "perms": {"ban_members": True}, 140 | "func": ban_members, 141 | "args": (guild, bot_member, reason) 142 | }, 143 | "manage_channels": { 144 | "name": "deleting channels", 145 | "perms": {"manage_channels": True}, 146 | "func": delete_channels, 147 | "args": (guild,) 148 | }, 149 | "manage_roles": { 150 | "name": "deleting roles", 151 | "perms": {"manage_roles": True}, 152 | "func": delete_roles, 153 | "args": (guild, bot_member) 154 | }, 155 | "manage_emojis": { 156 | "name": "deleting emojis", 157 | "perms": {"manage_emojis": True}, 158 | "func": delete_emojis, 159 | "args": (guild,) 160 | }, 161 | "manage_emojis_and_stickers": { 162 | "name": "deleting stickers", 163 | "perms": {"manage_emojis": True}, # Same permission for stickers 164 | "func": delete_stickers, 165 | "args": (guild,) 166 | } 167 | } 168 | 169 | # Process each action group with permission checks 170 | for action in action_groups.values(): 171 | proceed, missing = await check_permissions_and_confirm( 172 | guild, 173 | action["perms"], 174 | action["name"] 175 | ) 176 | 177 | if proceed and not missing: 178 | await action["func"](*action["args"]) 179 | 180 | print(f"{Fore.LIGHTGREEN_EX}Nuke operations completed") 181 | input("Press Enter to continue") 182 | 183 | async def ban_members(guild, bot_member, reason): 184 | members = [m for m in guild.members if m != client.user and m.top_role < bot_member.top_role] 185 | total = len(members) 186 | 187 | for idx, member in enumerate(members, 1): 188 | try: 189 | await member.ban(reason=reason, delete_message_days=7) 190 | print(f"{Fore.LIGHTGREEN_EX}[{idx}/{total}] Banned {Fore.YELLOW}{member}") 191 | except Exception as e: 192 | print(f"{Fore.RED}[{idx}/{total}] Failed to ban {Fore.YELLOW}{member}: {e}") 193 | 194 | if idx < total: 195 | await asyncio.sleep(random_cooldown(config.min_ban, config.max_ban)) 196 | 197 | async def delete_channels(guild): 198 | for channel in guild.channels: 199 | try: 200 | await channel.delete() 201 | print(f"{Fore.LIGHTGREEN_EX}Deleted channel: {Fore.YELLOW}{channel.name}") 202 | except Exception as e: 203 | print(f"{Fore.RED}Failed to delete channel {Fore.YELLOW}{channel.name}: {e}") 204 | await asyncio.sleep(random_cooldown(config.min_general, config.max_general)) 205 | 206 | async def delete_roles(guild, bot_member): 207 | for role in guild.roles: 208 | if role.name != "@everyone" and role.position < bot_member.top_role.position: 209 | try: 210 | await role.delete() 211 | print(f"{Fore.LIGHTGREEN_EX}Deleted role: {Fore.YELLOW}{role.name}") 212 | except Exception as e: 213 | print(f"{Fore.RED}Failed to delete role {Fore.YELLOW}{role.name}: {e}") 214 | await asyncio.sleep(random_cooldown(config.min_general, config.max_general)) 215 | 216 | async def delete_emojis(guild): 217 | emojis = await guild.fetch_emojis() 218 | if not emojis: 219 | print(f"{Fore.YELLOW}No emojis to delete") 220 | return 221 | 222 | for emoji in emojis: 223 | try: 224 | await emoji.delete() 225 | print(f"{Fore.LIGHTGREEN_EX}Deleted emoji: {Fore.YELLOW}{emoji.name}") 226 | except Exception as e: 227 | print(f"{Fore.RED}Failed to delete emoji {Fore.YELLOW}{emoji.name}: {e}") 228 | await asyncio.sleep(random_cooldown(config.min_general, config.max_general)) 229 | 230 | async def delete_stickers(guild): 231 | stickers = await guild.fetch_stickers() 232 | if not stickers: 233 | print(f"{Fore.YELLOW}No stickers to delete") 234 | return 235 | 236 | for sticker in stickers: 237 | try: 238 | await sticker.delete() 239 | print(f"{Fore.LIGHTGREEN_EX}Deleted sticker: {Fore.YELLOW}{sticker.name}") 240 | except Exception as e: 241 | print(f"{Fore.RED}Failed to delete sticker {Fore.YELLOW}{sticker.name}: {e}") 242 | await asyncio.sleep(random_cooldown(config.min_general, config.max_general)) 243 | 244 | async def raid_server(client, guild_id=None): 245 | if not guild_id: 246 | while True: 247 | try: 248 | guild_id = int(input(f'{Fore.LIGHTYELLOW_EX}Enter server ID: ')) 249 | break 250 | except ValueError: 251 | print(f'{Fore.RED}Invalid ID') 252 | 253 | guild = await client.get_guild_by_id(guild_id) 254 | if not guild: 255 | print(f"{Fore.RED}Server not found") 256 | return 257 | 258 | bot_member = guild.get_member(client.user.id) 259 | 260 | # Define action groups with required permissions 261 | action_groups = { 262 | "rename_server": { 263 | "name": "renaming server", 264 | "perms": {"manage_guild": True}, 265 | "func": rename_server, 266 | "args": (guild,) 267 | }, 268 | "create_channels": { 269 | "name": "creating channels", 270 | "perms": {"manage_channels": True}, 271 | "func": create_channels, 272 | "args": (guild,) 273 | }, 274 | "create_roles": { 275 | "name": "creating roles", 276 | "perms": {"manage_roles": True}, 277 | "func": create_roles, 278 | "args": (guild,) 279 | }, 280 | "change_nicks": { 281 | "name": "changing nicknames", 282 | "perms": {"manage_nicknames": True}, 283 | "func": change_nicknames, 284 | "args": (guild, bot_member) 285 | } 286 | } 287 | 288 | # Get user input for all actions first 289 | new_name = input("New server name (leave blank to skip): ") 290 | channel_name = input("Channel name to spam: ") 291 | channel_count = int(input("Number of channels to create (0 to skip): ")) 292 | role_name = input("Role name to spam: ") 293 | role_count = int(input("Number of roles to create (0 to skip): ")) 294 | nickname = input("Nickname to set (leave blank to skip): ") 295 | 296 | # Prepare arguments based on user input 297 | action_groups["rename_server"]["args"] = (guild, new_name) if new_name else None 298 | action_groups["create_channels"]["args"] = (guild, channel_name, channel_count) if channel_count > 0 else None 299 | action_groups["create_roles"]["args"] = (guild, role_name, role_count) if role_count > 0 else None 300 | action_groups["change_nicks"]["args"] = (guild, bot_member, nickname) if nickname else None 301 | 302 | # Process each action group 303 | for action in action_groups.values(): 304 | if action["args"] is None: 305 | continue 306 | 307 | proceed, missing = await check_permissions_and_confirm( 308 | guild, 309 | action["perms"], 310 | action["name"] 311 | ) 312 | 313 | if proceed and not missing: 314 | await action["func"](*action["args"]) 315 | 316 | print(f"{Fore.LIGHTGREEN_EX}Raid operations completed") 317 | input("Press Enter to continue") 318 | 319 | async def rename_server(guild, new_name): 320 | try: 321 | await guild.edit(name=new_name) 322 | print(f"{Fore.LIGHTGREEN_EX}Server renamed to {Fore.YELLOW}{new_name}") 323 | except Exception as e: 324 | print(f"{Fore.RED}Failed to rename server: {e}") 325 | 326 | async def create_channels(guild, channel_name, count): 327 | for i in range(count): 328 | try: 329 | await guild.create_text_channel(f"{channel_name}-{i+1}") 330 | print(f"{Fore.LIGHTGREEN_EX}Created channel {Fore.YELLOW}{channel_name}-{i+1}") 331 | except Exception as e: 332 | print(f"{Fore.RED}Failed to create channel: {e}") 333 | await asyncio.sleep(random_cooldown(config.min_general, config.max_general)) 334 | 335 | async def create_roles(guild, role_name, count): 336 | for i in range(count): 337 | try: 338 | await guild.create_role(name=f"{role_name}-{i+1}") 339 | print(f"{Fore.LIGHTGREEN_EX}Created role {Fore.YELLOW}{role_name}-{i+1}") 340 | except Exception as e: 341 | print(f"{Fore.RED}Failed to create role: {e}") 342 | await asyncio.sleep(random_cooldown(config.min_general, config.max_general)) 343 | 344 | async def change_nicknames(guild, bot_member, nickname): 345 | members = [m for m in guild.members if m != client.user and m.top_role < bot_member.top_role] 346 | for member in members: 347 | try: 348 | await member.edit(nick=nickname) 349 | print(f"{Fore.LIGHTGREEN_EX}Changed nickname for {Fore.YELLOW}{member}") 350 | except Exception as e: 351 | print(f"{Fore.RED}Failed to change nickname for {Fore.YELLOW}{member}: {e}") 352 | await asyncio.sleep(random_cooldown(config.min_general, config.max_general)) 353 | 354 | async def create_embed(): 355 | embed = discord.Embed() 356 | 357 | title = input(f"{Fore.LIGHTGREEN_EX}Embed title (leave blank for none): ") 358 | if title: 359 | embed.title = title 360 | 361 | description = input(f"{Fore.LIGHTGREEN_EX}Embed description (leave blank for none): ") 362 | if description: 363 | embed.description = description 364 | 365 | color = input(f"{Fore.LIGHTGREEN_EX}Embed color (hex without #, e.g., FF0000 for red): ") 366 | if color: 367 | try: 368 | embed.color = int(color, 16) 369 | except: 370 | embed.color = discord.Color.random() 371 | 372 | # Add fields 373 | while True: 374 | field_name = input(f"{Fore.LIGHTGREEN_EX}Add field? Enter name (leave blank to stop): ") 375 | if not field_name: 376 | break 377 | field_value = input(f"{Fore.LIGHTGREEN_EX}Field value: ") 378 | inline = input(f"{Fore.LIGHTGREEN_EX}Inline field? (y/n): ").lower() == 'y' 379 | embed.add_field(name=field_name, value=field_value, inline=inline) 380 | 381 | # Set author 382 | author_name = input(f"{Fore.LIGHTGREEN_EX}Author name (leave blank for none): ") 383 | if author_name: 384 | author_icon = input(f"{Fore.LIGHTGREEN_EX}Author icon URL (leave blank for none): ") 385 | embed.set_author(name=author_name, icon_url=author_icon if author_icon else None) 386 | 387 | # Set footer 388 | footer_text = input(f"{Fore.LIGHTGREEN_EX}Footer text (leave blank for none): ") 389 | if footer_text: 390 | footer_icon = input(f"{Fore.LIGHTGREEN_EX}Footer icon URL (leave blank for none): ") 391 | embed.set_footer(text=footer_text, icon_url=footer_icon if footer_icon else None) 392 | 393 | # Set thumbnail 394 | thumbnail = input(f"{Fore.LIGHTGREEN_EX}Thumbnail URL (leave blank for none): ") 395 | if thumbnail: 396 | embed.set_thumbnail(url=thumbnail) 397 | 398 | # Set image 399 | image = input(f"{Fore.LIGHTGREEN_EX}Image URL (leave blank for none): ") 400 | if image: 401 | embed.set_image(url=image) 402 | 403 | return embed 404 | 405 | async def mass_dm_users(users): 406 | message_type = input(f"{Fore.LIGHTGREEN_EX}Message type (text/embed/both): ").lower() 407 | 408 | text_content = None 409 | embed_content = None 410 | 411 | if message_type in ['text', 'both']: 412 | text_content = input(f"{Fore.LIGHTGREEN_EX}Enter text message: ") 413 | 414 | if message_type in ['embed', 'both']: 415 | embed_content = await create_embed() 416 | 417 | if not text_content and not embed_content: 418 | print(f"{Fore.RED}No message content provided") 419 | return 420 | 421 | total = len(users) 422 | for idx, user in enumerate(users, 1): 423 | try: 424 | # Skip if user is the bot itself 425 | if user.id == client.user.id: 426 | continue 427 | 428 | # Skip bots 429 | if user.bot: 430 | continue 431 | 432 | if text_content and embed_content: 433 | await user.send(content=text_content, embed=embed_content) 434 | elif text_content: 435 | await user.send(content=text_content) 436 | elif embed_content: 437 | await user.send(embed=embed_content) 438 | 439 | print(f"{Fore.LIGHTGREEN_EX}[{idx}/{total}] Sent to {Fore.YELLOW}{user}") 440 | except Exception as e: 441 | print(f"{Fore.RED}[{idx}/{total}] Failed to send to {Fore.YELLOW}{user}: {e}") 442 | 443 | if idx < total: 444 | await asyncio.sleep(random_cooldown(config.minimum_dm, config.maximum_dm)) 445 | 446 | async def mass_dm_server(client, guild_id=None): 447 | if not guild_id: 448 | while True: 449 | try: 450 | guild_id = int(input(f'{Fore.LIGHTYELLOW_EX}Enter server ID: ')) 451 | break 452 | except ValueError: 453 | print(f'{Fore.RED}Invalid ID') 454 | 455 | guild = await client.get_guild_by_id(guild_id) 456 | if not guild: 457 | print(f"{Fore.RED}Server not found") 458 | return 459 | 460 | print(f'Target: {Fore.YELLOW}{guild.name}') 461 | 462 | members = [m for m in guild.members if not m.bot] # Exclude bots 463 | await mass_dm_users(members) 464 | 465 | async def mass_dm_all_users(client): 466 | users = [u for u in client.users if not u.bot] # Exclude bots 467 | await mass_dm_users(users) 468 | 469 | async def list_servers(client): 470 | print(f"{Fore.LIGHTGREEN_EX}Connected servers:") 471 | for guild in client.guilds: 472 | bot_member = guild.get_member(client.user.id) 473 | perms = [] 474 | 475 | # Existing permission checks 476 | if bot_member.guild_permissions.ban_members: 477 | perms.append("Ban") 478 | if bot_member.guild_permissions.manage_channels: 479 | perms.append("Channels") 480 | if bot_member.guild_permissions.manage_roles: 481 | perms.append("Roles") 482 | if bot_member.guild_permissions.manage_nicknames: 483 | perms.append("Nicks") 484 | if bot_member.guild_permissions.manage_emojis: 485 | perms.append("Emojis") 486 | if bot_member.guild_permissions.manage_guild: 487 | perms.append("Server") 488 | if bot_member.guild_permissions.create_instant_invite: 489 | perms.append("Invites") 490 | 491 | perm_status = f"{Fore.LIGHTGREEN_EX}Perms: {', '.join(perms)}" if perms else f"{Fore.RED}No key perms" 492 | 493 | print(f"\n{Fore.YELLOW}{guild.name} {Fore.LIGHTGREEN_EX}(ID: {guild.id}, Members: {guild.member_count}) {perm_status}") 494 | 495 | # Fetch and display permanent invites (non-expiring) 496 | if bot_member.guild_permissions.manage_guild: 497 | try: 498 | invites = await guild.invites() 499 | permanent_invites = [inv for inv in invites if inv.max_age == 0] # Filter out expiring invites 500 | 501 | if permanent_invites: 502 | print(f"{Fore.CYAN} Permanent Invites:") 503 | for invite in permanent_invites: 504 | print(f" - {Fore.LIGHTBLUE_EX}{invite.url} (Uses: {invite.uses}, Created by: {invite.inviter})") 505 | else: 506 | print(f"{Fore.RED} No permanent invites found.") 507 | except discord.Forbidden: 508 | print(f"{Fore.RED} No invite access (missing 'Manage Server' permission)") 509 | except Exception as e: 510 | print(f"{Fore.RED} Failed to fetch invites: {e}") 511 | 512 | input("\nPress Enter to continue...") 513 | 514 | async def leave_all_servers(client): 515 | confirm = input(f"{Fore.RED}Are you sure? (yes/no): ").lower() 516 | if confirm != "yes": 517 | return 518 | 519 | for guild in client.guilds: 520 | try: 521 | await guild.leave() 522 | print(f"{Fore.LIGHTGREEN_EX}Left {Fore.YELLOW}{guild.name}") 523 | except Exception as e: 524 | print(f"{Fore.RED}Failed to leave {Fore.YELLOW}{guild.name}: {e}") 525 | await asyncio.sleep(1) 526 | 527 | print(f"{Fore.LIGHTGREEN_EX}Left all servers") 528 | input("Press Enter to continue") 529 | 530 | async def main_menu(client): 531 | while True: 532 | await clear_console() 533 | print(pyfade.Fade.Horizontal(pyfade.Colors.yellow_to_red, ''' 534 | ██╗ ██╗ █████╗ ██████╗ ██╗ ██╗███╗ ███╗ █████╗ 535 | ██║ ██╔╝██╔══██╗██╔══██╗██║ ██║████╗ ████║██╔══██╗ 536 | █████═╝ ███████║██████╔╝██║ ██║██╔████╔██║███████║ 537 | ██╔═██╗ ██╔══██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══██║ 538 | ██║ ╚██╗██║ ██║██║ ██║╚██████╔╝██║ ╚═╝ ██║██║ ██║ 539 | ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝''')) 540 | 541 | stats = f"Servers: {len(client.guilds)} | Users: {len(client.users)}" 542 | 543 | print(f'''{Fore.LIGHTWHITE_EX} Made by {Fore.YELLOW}hoemotion 544 | 545 | {Fore.LIGHTWHITE_EX}GitHub: {Fore.LIGHTBLUE_EX}https://github.com/hoemotion/Karuma 546 | {Fore.LIGHTGREEN_EX}Logged in as: {Fore.YELLOW}{client.user} 547 | {Fore.LIGHTGREEN_EX}{stats} 548 | 549 | {Fore.LIGHTGREEN_EX}[1] Nuke Server (Ban members, delete channels/roles/emojis/stickers) 550 | {Fore.LIGHTGREEN_EX}[2] Raid Server (Spam channels/roles, change nicks) 551 | {Fore.LIGHTGREEN_EX}[3] Mass DM Server (with embed support) 552 | {Fore.LIGHTGREEN_EX}[4] Mass DM All Users (with embed support) 553 | {Fore.LIGHTGREEN_EX}[5] List Servers (with permission info) 554 | {Fore.LIGHTGREEN_EX}[6] Leave All Servers 555 | {Fore.LIGHTGREEN_EX}[7] Exit 556 | ''') 557 | 558 | choice = input(f"{Fore.LIGHTGREEN_EX}Select>> ").lower() 559 | 560 | if choice == '1': 561 | await nuke_server(client) 562 | elif choice == '2': 563 | await raid_server(client) 564 | elif choice == '3': 565 | await mass_dm_server(client) 566 | elif choice == '4': 567 | await mass_dm_all_users(client) 568 | elif choice == '5': 569 | await list_servers(client) 570 | elif choice == '6': 571 | await leave_all_servers(client) 572 | elif choice in ['7', 'quit', 'exit']: 573 | print(f"{Fore.LIGHTGREEN_EX}Goodbye!") 574 | await client.close() 575 | sys.exit(0) 576 | else: 577 | print(f"{Fore.RED}Invalid choice") 578 | await asyncio.sleep(1) 579 | 580 | async def main(): 581 | await show_disclaimer() 582 | await show_boot_animation() 583 | 584 | global client 585 | client = KarumaBot() 586 | try: 587 | await client.start(config.token) 588 | except discord.LoginFailure: 589 | print(f"{Fore.RED}Invalid token - check your config.json") 590 | sys.exit(1) 591 | except Exception as e: 592 | print(f"{Fore.RED}Error: {e}") 593 | sys.exit(1) 594 | 595 | if __name__ == "__main__": 596 | asyncio.run(main()) 597 | --------------------------------------------------------------------------------