CodeX
This commit is contained in:
@@ -22,6 +22,7 @@ from typing import List, Dict
|
||||
from discord.ui import LayoutView, TextDisplay, Separator, Container
|
||||
from utils.Tools import *
|
||||
from utils.cv2 import CV2, build_container
|
||||
from utils.config import OWNER_IDS
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +40,7 @@ class BasicView(discord.ui.View):
|
||||
self.ctx = ctx
|
||||
|
||||
async def interaction_check(self, interaction: discord.Interaction):
|
||||
if interaction.user.id != self.ctx.author.id and interaction.user.id not in [870179991462236170]:
|
||||
if interaction.user.id != self.ctx.author.id and interaction.user.id not in OWNER_IDS:
|
||||
await interaction.response.send_message("Uh oh! That message doesn't belong to you.\nYou must run this command to interact with it.", ephemeral=True)
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -16,11 +16,7 @@ import discord
|
||||
from discord.ui import LayoutView, TextDisplay, Separator, Container, Button, ActionRow
|
||||
from discord.ext import commands
|
||||
from utils.cv2 import CV2, build_container
|
||||
|
||||
authorized_staff_ids = [
|
||||
1263404140965396555,
|
||||
767979794411028491
|
||||
]
|
||||
from utils.config import STAFF_IDS
|
||||
|
||||
|
||||
class SuccessView(LayoutView):
|
||||
@@ -88,7 +84,7 @@ class StaffDMCog(commands.Cog):
|
||||
|
||||
@commands.command(name="dmstaff")
|
||||
async def dm_staff(self, ctx, member: discord.Member, *, message: str):
|
||||
if ctx.author.id not in authorized_staff_ids:
|
||||
if ctx.author.id not in STAFF_IDS:
|
||||
view = PermissionErrorView()
|
||||
await ctx.reply(view=view)
|
||||
return
|
||||
|
||||
@@ -19,6 +19,7 @@ from discord.ext import commands
|
||||
import aiosqlite
|
||||
from utils.Tools import *
|
||||
from utils.cv2 import CV2, build_container
|
||||
from utils.config import OWNER_IDS_STR
|
||||
|
||||
|
||||
class EmergencyRestoreConfirmView(LayoutView):
|
||||
@@ -419,9 +420,7 @@ class Emergency(commands.Cog):
|
||||
@commands.cooldown(1, 4, commands.BucketType.user)
|
||||
@commands.guild_only()
|
||||
async def enable(self, ctx):
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
||||
"870179991462236170"
|
||||
]:
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||
return await ctx.reply(view=EnableErrorView())
|
||||
dangerous_perms = [
|
||||
"administrator",
|
||||
@@ -460,9 +459,7 @@ class Emergency(commands.Cog):
|
||||
@commands.cooldown(1, 4, commands.BucketType.user)
|
||||
@commands.guild_only()
|
||||
async def disable(self, ctx):
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
||||
"870179991462236170"
|
||||
]:
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||
return await ctx.reply(view=DisableErrorView())
|
||||
async with aiosqlite.connect(self.db_path) as db:
|
||||
await db.execute(
|
||||
@@ -626,7 +623,7 @@ class Emergency(commands.Cog):
|
||||
async def emergencysituation(self, ctx):
|
||||
if not await self.is_guild_owner_or_authorised(ctx) and str(
|
||||
ctx.author.id
|
||||
) not in ["870179991462236170"]:
|
||||
) not in OWNER_IDS_STR:
|
||||
return await ctx.reply(view=EmergencySituationErrorView("access"))
|
||||
|
||||
proc_msg = await ctx.reply(
|
||||
@@ -746,9 +743,7 @@ class Emergency(commands.Cog):
|
||||
@commands.guild_only()
|
||||
@commands.bot_has_permissions(manage_roles=True)
|
||||
async def emergencyrestore(self, ctx):
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in [
|
||||
"870179991462236170"
|
||||
]:
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in OWNER_IDS_STR:
|
||||
return await ctx.reply(view=EmergencyRestoreAccessErrorView())
|
||||
|
||||
async with aiosqlite.connect(self.db_path) as db:
|
||||
|
||||
@@ -19,6 +19,7 @@ from discord.ui import LayoutView, TextDisplay, Separator, Container, ActionRow,
|
||||
import aiosqlite
|
||||
from utils.Tools import *
|
||||
from utils.cv2 import CV2, build_container
|
||||
from utils.config import OWNER_IDS_STR
|
||||
|
||||
|
||||
|
||||
@@ -106,7 +107,7 @@ class Extraowner(commands.Cog):
|
||||
if ctx.guild.member_count < 2:
|
||||
return await ctx.send(view=CV2(f"{CROSS} Error", "Your Server Doesn't Meet My 30 Member Criteria"))
|
||||
|
||||
Ray = ['870179991462236170','767979794411028491']
|
||||
Ray = OWNER_IDS_STR
|
||||
if ctx.author.id != ctx.guild.owner_id and str(ctx.author.id) not in Ray:
|
||||
return await ctx.send(view=CV2(f"{ZWARNING} Access Denied", "Only Server Owner Can Run This Command"))
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import os
|
||||
from utils.Tools import *
|
||||
from utils.cv2 import CV2
|
||||
from discord.ui import TextDisplay, Separator, ActionRow, LayoutView, Container
|
||||
from utils.config import OWNER_IDS_STR
|
||||
|
||||
# Database setup
|
||||
db_folder = "db"
|
||||
@@ -30,7 +31,7 @@ class Nightmode(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.bot.loop.create_task(self.initialize_db())
|
||||
self.ricky = ["870179991462236170", "767979794411028491"]
|
||||
self.ricky = OWNER_IDS_STR
|
||||
self.color = 0xFF0000
|
||||
|
||||
async def initialize_db(self):
|
||||
|
||||
@@ -418,7 +418,7 @@ class NoPrefix(commands.Cog):
|
||||
url=user.display_avatar.url if user.avatar else user.default_avatar.url
|
||||
)
|
||||
embed_log.set_footer(text="No Prefix Removal Log")
|
||||
await log_channel.send("<@870179991462236170>", view=embed_log)
|
||||
await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed_log)
|
||||
|
||||
@_np.command(
|
||||
name="status", help="Check if a user is in the No Prefix list and show details."
|
||||
@@ -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}",
|
||||
color=0xFF0000,
|
||||
)
|
||||
message = await log_channel.send("<@870179991462236170>", view=embed)
|
||||
message = await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed)
|
||||
await message.publish()
|
||||
|
||||
elif before.premium_since is not None and after.premium_since is None:
|
||||
@@ -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}",
|
||||
color=0xFF0000,
|
||||
)
|
||||
message = await log_channel.send("<@870179991462236170>", view=embed)
|
||||
message = await log_channel.send(" ".join(f"<@{oid}>" for oid in OWNER_IDS), view=embed)
|
||||
await message.publish()
|
||||
|
||||
async def add_np(self, user, duration):
|
||||
|
||||
@@ -24,7 +24,7 @@ import aiosqlite
|
||||
from typing import Optional
|
||||
from utils import Paginator, DescriptionEmbedPaginator, FieldPagePaginator, TextPaginator
|
||||
from utils.Tools import *
|
||||
from utils.config import OWNER_IDS
|
||||
from utils.config import OWNER_IDS, BOT_OWNER_IDS
|
||||
from utils.emoji import BOOSTS, DISCORD_BADGE_EMOJIS, LOADINGRED, NITRO_BOOST, TICK, ZWARNING
|
||||
from core import Cog, zyrox, Context
|
||||
import sqlite3
|
||||
@@ -32,7 +32,7 @@ import os
|
||||
import requests
|
||||
import numpy as np
|
||||
from io import BytesIO
|
||||
from utils.config import OWNER_IDS
|
||||
from utils.config import OWNER_IDS, BOT_OWNER_IDS
|
||||
from discord.errors import Forbidden
|
||||
from discord import Embed
|
||||
from discord.ui import Button, View
|
||||
@@ -42,7 +42,7 @@ from utils.config import *
|
||||
|
||||
|
||||
# --- Configuration & Helpers ---
|
||||
OWNER_IDS = [1258831252748894436]
|
||||
# OWNER_IDS and BOT_OWNER_IDS are imported from utils.config — edit .env to change them
|
||||
|
||||
# Your custom bot badges, including Family and Developer
|
||||
BADGE_URLS = {
|
||||
@@ -138,7 +138,7 @@ class Owner(commands.Cog):
|
||||
self.np_cache = []
|
||||
self.db_path = 'db/np.db'
|
||||
self.stop_tour = False
|
||||
self.bot_owner_ids = [870179991462236170,1432771000629596225,1382744437049790495]
|
||||
self.bot_owner_ids = BOT_OWNER_IDS
|
||||
self.client.loop.create_task(self.setup_database())
|
||||
self.client.loop.create_task(self.load_staff())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user