blacklist DSPL 💔 (#1293)
This commit is contained in:
+10
-11
@@ -34,7 +34,7 @@ from wcwidth import wcswidth
|
||||
# BOT/__init__.py has already put BOTS/SHARED on sys.path; re-export it
|
||||
# under a public name so peer modules can use it for asset paths.
|
||||
from . import SHARED_DIR # noqa: F401 — re-exported for siblings
|
||||
from shared_store import check_user_blacklist
|
||||
from shared_store import check_user_blacklist, blacklisted_guilds
|
||||
from data_parser import (
|
||||
LangTableReader,
|
||||
UnitTags,
|
||||
@@ -127,12 +127,10 @@ def decompress_json(data):
|
||||
# BLACKLISTS
|
||||
# ============================================================================
|
||||
|
||||
BLACKLISTED_SERVER_IDS = [
|
||||
]
|
||||
|
||||
# Blacklisted users and squadrons now live in the shared, version-controlled
|
||||
# BOTS/SHARED/BLACKLIST.json (read via shared_store) so both bots share one
|
||||
# source of truth. Use check_user_blacklist() / shared_store.blacklisted_squadrons().
|
||||
# Blacklisted users, squadrons, and guilds now live in the shared,
|
||||
# version-controlled BOTS/SHARED/BLACKLIST.json (read via shared_store) so both
|
||||
# bots share one source of truth. Use check_user_blacklist() /
|
||||
# shared_store.blacklisted_squadrons() / shared_store.blacklisted_guilds().
|
||||
|
||||
# ── Premium / Entitlements ────────────────────────────────────────────────────
|
||||
PREMIUM_ACTIVATION_TS: int = 1775459700 # Unix timestamp when premium gating activates
|
||||
@@ -527,9 +525,10 @@ async def is_dev_team(interaction: discord.Interaction) -> bool:
|
||||
def is_blacklisted():
|
||||
"""Return an app-command check that rejects blacklisted users or guilds.
|
||||
|
||||
Blacklisted users come from the shared BLACKLIST.json (see
|
||||
``shared_store.check_user_blacklist``); entries there may include an
|
||||
internal comment/name and an optional reason.
|
||||
Both blacklisted users and blacklisted guilds come from the shared
|
||||
BLACKLIST.json (see ``shared_store.check_user_blacklist`` and
|
||||
``shared_store.blacklisted_guilds``); entries there may include an internal
|
||||
comment/name and an optional reason.
|
||||
|
||||
Raises:
|
||||
BlacklistCheckFailure: If the guild or user is blacklisted,
|
||||
@@ -537,7 +536,7 @@ def is_blacklisted():
|
||||
"""
|
||||
async def predicate(interaction: discord.Interaction):
|
||||
guild = interaction.guild
|
||||
if guild is not None and guild.id in BLACKLISTED_SERVER_IDS:
|
||||
if guild is not None and guild.id in blacklisted_guilds():
|
||||
raise BlacklistCheckFailure(t("en", "common.access_denied_desc"))
|
||||
|
||||
blocked, reason = check_user_blacklist(interaction.user.id)
|
||||
|
||||
Reference in New Issue
Block a user