CodeX
This commit is contained in:
@@ -2,6 +2,9 @@ TOKEN = TOKEN_HERE
|
|||||||
brand_name='ZyroX'
|
brand_name='ZyroX'
|
||||||
NEXT_PUBLIC_BRAND_NAME='ZyroX'
|
NEXT_PUBLIC_BRAND_NAME='ZyroX'
|
||||||
|
|
||||||
|
# Owner
|
||||||
|
OWNER_IDS=870179991462236170,767979794411028491
|
||||||
|
|
||||||
# LAVALINK CONFIG
|
# LAVALINK CONFIG
|
||||||
LAVALINK_HOST="lavalink.jirayu.net"
|
LAVALINK_HOST="lavalink.jirayu.net"
|
||||||
LAVALINK_PASSWORD="youshallnotpass"
|
LAVALINK_PASSWORD="youshallnotpass"
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ async def on_guild_join(guild: discord.Guild):
|
|||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
async def on_command_completion(context: commands.Context) -> None:
|
async def on_command_completion(context: commands.Context) -> None:
|
||||||
if context.author.id == 870179991462236170:
|
if context.author.id in OWNER_IDS:
|
||||||
return
|
return
|
||||||
|
|
||||||
full_command_name = context.command.qualified_name
|
full_command_name = context.command.qualified_name
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ from typing import List, Dict
|
|||||||
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
||||||
from utils.Tools import *
|
from utils.Tools import *
|
||||||
from utils.cv2 import CV2, build_container
|
from utils.cv2 import CV2, build_container
|
||||||
|
from utils.config import OWNER_IDS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ class BasicView(discord.ui.View):
|
|||||||
self.ctx = ctx
|
self.ctx = ctx
|
||||||
|
|
||||||
async def interaction_check(self, interaction: discord.Interaction):
|
async def interaction_check(self, interaction: discord.Interaction):
|
||||||
if interaction.user.id != self.ctx.author.id and interaction.user.id not in [870179991462236170]:
|
if interaction.user.id != self.ctx.author.id and interaction.user.id not in OWNER_IDS:
|
||||||
await interaction.response.send_message("Uh oh! That message doesn't belong to you.\nYou must run this command to interact with it.", ephemeral=True)
|
await interaction.response.send_message("Uh oh! That message doesn't belong to you.\nYou must run this command to interact with it.", ephemeral=True)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -16,11 +16,7 @@ import discord
|
|||||||
from discord.ui import LayoutView, TextDisplay, Separator, Container, Button, ActionRow
|
from discord.ui import LayoutView, TextDisplay, Separator, Container, Button, ActionRow
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from utils.cv2 import CV2, build_container
|
from utils.cv2 import CV2, build_container
|
||||||
|
from utils.config import STAFF_IDS
|
||||||
authorized_staff_ids = [
|
|
||||||
1263404140965396555,
|
|
||||||
767979794411028491
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class SuccessView(LayoutView):
|
class SuccessView(LayoutView):
|
||||||
@@ -88,7 +84,7 @@ class StaffDMCog(commands.Cog):
|
|||||||
|
|
||||||
@commands.command(name="dmstaff")
|
@commands.command(name="dmstaff")
|
||||||
async def dm_staff(self, ctx, member: discord.Member, *, message: str):
|
async def dm_staff(self, ctx, member: discord.Member, *, message: str):
|
||||||
if ctx.author.id not in authorized_staff_ids:
|
if ctx.author.id not in STAFF_IDS:
|
||||||
view = PermissionErrorView()
|
view = PermissionErrorView()
|
||||||
await ctx.reply(view=view)
|
await ctx.reply(view=view)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ from discord.ext import commands
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
from utils.Tools import *
|
from utils.Tools import *
|
||||||
from utils.cv2 import CV2, build_container
|
from utils.cv2 import CV2, build_container
|
||||||
|
from utils.config import OWNER_IDS_STR
|
||||||
|
|
||||||
|
|
||||||
class EmergencyRestoreConfirmView(LayoutView):
|
class EmergencyRestoreConfirmView(LayoutView):
|
||||||
@@ -419,9 +420,7 @@ class Emergency(commands.Cog):
|
|||||||
@commands.cooldown(1, 4, commands.BucketType.user)
|
@commands.cooldown(1, 4, commands.BucketType.user)
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def enable(self, ctx):
|
async def enable(self, ctx):
|
||||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||||
"870179991462236170"
|
|
||||||
]:
|
|
||||||
return await ctx.reply(view=EnableErrorView())
|
return await ctx.reply(view=EnableErrorView())
|
||||||
dangerous_perms = [
|
dangerous_perms = [
|
||||||
"administrator",
|
"administrator",
|
||||||
@@ -460,9 +459,7 @@ class Emergency(commands.Cog):
|
|||||||
@commands.cooldown(1, 4, commands.BucketType.user)
|
@commands.cooldown(1, 4, commands.BucketType.user)
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def disable(self, ctx):
|
async def disable(self, ctx):
|
||||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||||
"870179991462236170"
|
|
||||||
]:
|
|
||||||
return await ctx.reply(view=DisableErrorView())
|
return await ctx.reply(view=DisableErrorView())
|
||||||
async with aiosqlite.connect(self.db_path) as db:
|
async with aiosqlite.connect(self.db_path) as db:
|
||||||
await db.execute(
|
await db.execute(
|
||||||
@@ -626,7 +623,7 @@ class Emergency(commands.Cog):
|
|||||||
async def emergencysituation(self, ctx):
|
async def emergencysituation(self, ctx):
|
||||||
if not await self.is_guild_owner_or_authorised(ctx) and str(
|
if not await self.is_guild_owner_or_authorised(ctx) and str(
|
||||||
ctx.author.id
|
ctx.author.id
|
||||||
) not in ["870179991462236170"]:
|
) not in OWNER_IDS_STR:
|
||||||
return await ctx.reply(view=EmergencySituationErrorView("access"))
|
return await ctx.reply(view=EmergencySituationErrorView("access"))
|
||||||
|
|
||||||
proc_msg = await ctx.reply(
|
proc_msg = await ctx.reply(
|
||||||
@@ -746,9 +743,7 @@ class Emergency(commands.Cog):
|
|||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
@commands.bot_has_permissions(manage_roles=True)
|
@commands.bot_has_permissions(manage_roles=True)
|
||||||
async def emergencyrestore(self, ctx):
|
async def emergencyrestore(self, ctx):
|
||||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||||
"870179991462236170"
|
|
||||||
]:
|
|
||||||
return await ctx.reply(view=EmergencyRestoreAccessErrorView())
|
return await ctx.reply(view=EmergencyRestoreAccessErrorView())
|
||||||
|
|
||||||
async with aiosqlite.connect(self.db_path) as db:
|
async with aiosqlite.connect(self.db_path) as db:
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ from discord.ui import LayoutView, TextDisplay, Separator, Container, ActionRow,
|
|||||||
import aiosqlite
|
import aiosqlite
|
||||||
from utils.Tools import *
|
from utils.Tools import *
|
||||||
from utils.cv2 import CV2, build_container
|
from utils.cv2 import CV2, build_container
|
||||||
|
from utils.config import OWNER_IDS_STR
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -106,7 +107,7 @@ class Extraowner(commands.Cog):
|
|||||||
if ctx.guild.member_count < 2:
|
if ctx.guild.member_count < 2:
|
||||||
return await ctx.send(view=CV2(f"{CROSS} Error", "Your Server Doesn't Meet My 30 Member Criteria"))
|
return await ctx.send(view=CV2(f"{CROSS} Error", "Your Server Doesn't Meet My 30 Member Criteria"))
|
||||||
|
|
||||||
Ray = ['870179991462236170','767979794411028491']
|
Ray = OWNER_IDS_STR
|
||||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in Ray:
|
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in Ray:
|
||||||
return await ctx.send(view=CV2(f"{ZWARNING} Access Denied", "Only Server Owner Can Run This Command"))
|
return await ctx.send(view=CV2(f"{ZWARNING} Access Denied", "Only Server Owner Can Run This Command"))
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import os
|
|||||||
from utils.Tools import *
|
from utils.Tools import *
|
||||||
from utils.cv2 import CV2
|
from utils.cv2 import CV2
|
||||||
from discord.ui import TextDisplay, Separator, ActionRow, LayoutView, Container
|
from discord.ui import TextDisplay, Separator, ActionRow, LayoutView, Container
|
||||||
|
from utils.config import OWNER_IDS_STR
|
||||||
|
|
||||||
# Database setup
|
# Database setup
|
||||||
db_folder = "db"
|
db_folder = "db"
|
||||||
@@ -30,7 +31,7 @@ class Nightmode(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.bot.loop.create_task(self.initialize_db())
|
self.bot.loop.create_task(self.initialize_db())
|
||||||
self.ricky = ["870179991462236170", "767979794411028491"]
|
self.ricky = OWNER_IDS_STR
|
||||||
self.color = 0xFF0000
|
self.color = 0xFF0000
|
||||||
|
|
||||||
async def initialize_db(self):
|
async def initialize_db(self):
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ class NoPrefix(commands.Cog):
|
|||||||
url=user.display_avatar.url if user.avatar else user.default_avatar.url
|
url=user.display_avatar.url if user.avatar else user.default_avatar.url
|
||||||
)
|
)
|
||||||
embed_log.set_footer(text="No Prefix Removal Log")
|
embed_log.set_footer(text="No Prefix Removal Log")
|
||||||
await log_channel.send("<@870179991462236170>", view=embed_log)
|
await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed_log)
|
||||||
|
|
||||||
@_np.command(
|
@_np.command(
|
||||||
name="status", help="Check if a user is in the No Prefix list and show details."
|
name="status", help="Check if a user is in the No Prefix list and show details."
|
||||||
@@ -544,7 +544,7 @@ class NoPrefix(commands.Cog):
|
|||||||
description=f"**User**: **[{after}](https://discord.com/users/{after.id})** (ID: {after.id})\n**Server**: {after.guild.name}",
|
description=f"**User**: **[{after}](https://discord.com/users/{after.id})** (ID: {after.id})\n**Server**: {after.guild.name}",
|
||||||
color=0xFF0000,
|
color=0xFF0000,
|
||||||
)
|
)
|
||||||
message = await log_channel.send("<@870179991462236170>", view=embed)
|
message = await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed)
|
||||||
await message.publish()
|
await message.publish()
|
||||||
|
|
||||||
elif before.premium_since is not None and after.premium_since is None:
|
elif before.premium_since is not None and after.premium_since is None:
|
||||||
@@ -569,7 +569,7 @@ class NoPrefix(commands.Cog):
|
|||||||
description=f"**User**: **[{user}](https://discord.com/users/{user.id})** (ID: {user.id})\n**Server**: {user.guild.name}",
|
description=f"**User**: **[{user}](https://discord.com/users/{user.id})** (ID: {user.id})\n**Server**: {user.guild.name}",
|
||||||
color=0xFF0000,
|
color=0xFF0000,
|
||||||
)
|
)
|
||||||
message = await log_channel.send("<@870179991462236170>", view=embed)
|
message = await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed)
|
||||||
await message.publish()
|
await message.publish()
|
||||||
|
|
||||||
async def add_np(self, user, duration):
|
async def add_np(self, user, duration):
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import aiosqlite
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
from utils import Paginator, DescriptionEmbedPaginator, FieldPagePaginator, TextPaginator
|
from utils import Paginator, DescriptionEmbedPaginator, FieldPagePaginator, TextPaginator
|
||||||
from utils.Tools import *
|
from utils.Tools import *
|
||||||
from utils.config import OWNER_IDS
|
from utils.config import OWNER_IDS, BOT_OWNER_IDS
|
||||||
from utils.emoji import BOOSTS, DISCORD_BADGE_EMOJIS, LOADINGRED, NITRO_BOOST, TICK, ZWARNING
|
from utils.emoji import BOOSTS, DISCORD_BADGE_EMOJIS, LOADINGRED, NITRO_BOOST, TICK, ZWARNING
|
||||||
from core import Cog, zyrox, Context
|
from core import Cog, zyrox, Context
|
||||||
import sqlite3
|
import sqlite3
|
||||||
@@ -32,7 +32,7 @@ import os
|
|||||||
import requests
|
import requests
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from utils.config import OWNER_IDS
|
from utils.config import OWNER_IDS, BOT_OWNER_IDS
|
||||||
from discord.errors import Forbidden
|
from discord.errors import Forbidden
|
||||||
from discord import Embed
|
from discord import Embed
|
||||||
from discord.ui import Button, View
|
from discord.ui import Button, View
|
||||||
@@ -42,7 +42,7 @@ from utils.config import *
|
|||||||
|
|
||||||
|
|
||||||
# --- Configuration & Helpers ---
|
# --- Configuration & Helpers ---
|
||||||
OWNER_IDS = [1258831252748894436]
|
# OWNER_IDS and BOT_OWNER_IDS are imported from utils.config — edit .env to change them
|
||||||
|
|
||||||
# Your custom bot badges, including Family and Developer
|
# Your custom bot badges, including Family and Developer
|
||||||
BADGE_URLS = {
|
BADGE_URLS = {
|
||||||
@@ -138,7 +138,7 @@ class Owner(commands.Cog):
|
|||||||
self.np_cache = []
|
self.np_cache = []
|
||||||
self.db_path = 'db/np.db'
|
self.db_path = 'db/np.db'
|
||||||
self.stop_tour = False
|
self.stop_tour = False
|
||||||
self.bot_owner_ids = [870179991462236170,1432771000629596225,1382744437049790495]
|
self.bot_owner_ids = BOT_OWNER_IDS
|
||||||
self.client.loop.create_task(self.setup_database())
|
self.client.loop.create_task(self.setup_database())
|
||||||
self.client.loop.create_task(self.load_staff())
|
self.client.loop.create_task(self.load_staff())
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
import discord
|
import discord
|
||||||
from utils.emoji import ACTIVE_DEVELOPER, BLACKCROWN, MINGLE, STAFF
|
from utils.emoji import ACTIVE_DEVELOPER, BLACKCROWN, MINGLE, STAFF
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
from utils.config import OWNER_IDS
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
class React(commands.Cog):
|
class React(commands.Cog):
|
||||||
@@ -29,17 +30,19 @@ class React(commands.Cog):
|
|||||||
for owner in self.bot.owner_ids:
|
for owner in self.bot.owner_ids:
|
||||||
if f"<@{owner}>" in message.content:
|
if f"<@{owner}>" in message.content:
|
||||||
try:
|
try:
|
||||||
if owner == 870179991462236170:
|
# Primary owner (first in OWNER_IDS) gets an extra emoji
|
||||||
|
if owner == OWNER_IDS[0]:
|
||||||
emojis = [
|
emojis = [
|
||||||
BLACKCROWN,
|
BLACKCROWN,
|
||||||
ACTIVE_DEVELOPER,
|
ACTIVE_DEVELOPER,
|
||||||
STAFF,
|
STAFF,
|
||||||
MINGLE ]
|
MINGLE,
|
||||||
|
]
|
||||||
else:
|
else:
|
||||||
emojis = [
|
emojis = [
|
||||||
BLACKCROWN,
|
BLACKCROWN,
|
||||||
ACTIVE_DEVELOPER,
|
ACTIVE_DEVELOPER,
|
||||||
STAFF
|
STAFF,
|
||||||
]
|
]
|
||||||
|
|
||||||
for emoji in emojis:
|
for emoji in emojis:
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
import discord
|
|
||||||
from utils.emoji import CODED, CUTE_CUTE_CUTE, GIFD, GIFN, HAPPY_PANDA, HEADMOD, HEART_EM, HEERIYE, KING, KING_ALT1, MAX__A, RACECAR64, REDHEART, SG_RD, STAR, STAR_ALT1, STAR_ALT2, ZBAN, _37496ALERT
|
|
||||||
from discord.ext import commands
|
|
||||||
import asyncio
|
|
||||||
|
|
||||||
class React(commands.Cog):
|
|
||||||
|
|
||||||
def __init__(self, bot):
|
|
||||||
self.bot = bot
|
|
||||||
|
|
||||||
@commands.Cog.listener()
|
|
||||||
async def on_message(self, message):
|
|
||||||
if message.author.bot:
|
|
||||||
return
|
|
||||||
for owner in self.bot.owner_ids:
|
|
||||||
if f"<@{owner}>" in message.content:
|
|
||||||
try:
|
|
||||||
if owner == 870179991462236170:
|
|
||||||
|
|
||||||
emojis = [
|
|
||||||
KING,
|
|
||||||
f"{ZBAN} ",
|
|
||||||
STAR,
|
|
||||||
CUTE_CUTE_CUTE,
|
|
||||||
HAPPY_PANDA,
|
|
||||||
_37496ALERT,
|
|
||||||
CODED,
|
|
||||||
RACECAR64,
|
|
||||||
GIFD,
|
|
||||||
GIFN,
|
|
||||||
MAX__A,
|
|
||||||
HEERIYE,
|
|
||||||
HEART_EM,
|
|
||||||
STAR_ALT1,
|
|
||||||
KING_ALT1,
|
|
||||||
HEADMOD,
|
|
||||||
f"{SG_RD} ",
|
|
||||||
REDHEART,
|
|
||||||
f" {STAR_ALT2}"
|
|
||||||
]
|
|
||||||
for emoji in emojis:
|
|
||||||
await message.add_reaction(emoji)
|
|
||||||
else:
|
|
||||||
|
|
||||||
await message.add_reaction(f"{KING},{RACECAR64},{CODED}")
|
|
||||||
except discord.errors.RateLimited as e:
|
|
||||||
await asyncio.sleep(e.retry_after)
|
|
||||||
await message.add_reaction(f"{KING},{RACECAR64},{CODED}")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"An unexpected error occurred Auto react owner mention: {e}")
|
|
||||||
@@ -17,12 +17,33 @@ from dotenv import load_dotenv
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
TOKEN = os.environ.get("TOKEN")
|
TOKEN = os.environ.get("TOKEN")
|
||||||
BRAND_NAME = os.environ.get("brand_name", "Zyrox X")
|
BRAND_NAME = os.environ.get("brand_name", "Zyrox X")
|
||||||
NAME = BRAND_NAME
|
NAME = BRAND_NAME
|
||||||
server = "https://discord.gg/codexdev"
|
BotName = BRAND_NAME
|
||||||
ch = "https://discord.com/channels/699587669059174461/1271825678710476911"
|
|
||||||
OWNER_IDS = [870179991462236170]
|
server = "https://discord.gg/codexdev"
|
||||||
BotName = BRAND_NAME
|
|
||||||
serverLink = "https://discord.gg/codexdev"
|
serverLink = "https://discord.gg/codexdev"
|
||||||
CMD_WEBHOOK_URL = os.getenv("CMD_WEBHOOK_URL")
|
ch = "https://discord.com/channels/699587669059174461/1271825678710476911"
|
||||||
|
|
||||||
|
CMD_WEBHOOK_URL = os.getenv("CMD_WEBHOOK_URL")
|
||||||
|
|
||||||
|
# ── Owner / Staff IDs ─────────────────────────────────────────────────────────
|
||||||
|
# Edit OWNER_IDS in .env — comma-separated, no spaces needed.
|
||||||
|
# Example: OWNER_IDS = 870179991462236170,767979794411028491,1432771000629596225
|
||||||
|
|
||||||
|
def _parse_ids(env_key: str, defaults: list[int]) -> list[int]:
|
||||||
|
raw = os.getenv(env_key, "").strip()
|
||||||
|
if not raw:
|
||||||
|
return defaults
|
||||||
|
ids = [int(p.strip()) for p in raw.split(",") if p.strip().isdigit()]
|
||||||
|
return ids or defaults
|
||||||
|
|
||||||
|
OWNER_IDS: list[int] = _parse_ids("OWNER_IDS", [870179991462236170])
|
||||||
|
OWNER_IDS_STR: list[str] = [str(i) for i in OWNER_IDS]
|
||||||
|
|
||||||
|
# Aliases kept for backwards compatibility with files that import these names
|
||||||
|
BOT_OWNER_IDS = OWNER_IDS
|
||||||
|
BOT_OWNER_IDS_STR = OWNER_IDS_STR
|
||||||
|
STAFF_IDS = OWNER_IDS
|
||||||
|
STAFF_IDS_STR = OWNER_IDS_STR
|
||||||
Reference in New Issue
Block a user