fix(bot): 🐛 Allow some words on call and allow @Payphone as command prefix.
This commit is contained in:
+11
-2
@@ -255,6 +255,8 @@ class Payphone(commands.AutoShardedBot):
|
||||
ValueError: Either `message` or `server_id` must be set, but not both.
|
||||
"""
|
||||
|
||||
default_prefixes = ["p.", "P.", self.user.mention]
|
||||
|
||||
if message is not None and server_id is not None:
|
||||
raise ValueError(
|
||||
"Either `message` or `server_id` must be set, but not both."
|
||||
@@ -264,10 +266,17 @@ class Payphone(commands.AutoShardedBot):
|
||||
raise ValueError("Either `message` or `server_id` must be set.")
|
||||
|
||||
if message is not None and message.guild is None:
|
||||
return ["p.", "P."]
|
||||
return default_prefixes
|
||||
|
||||
if message is not None and message.content is None:
|
||||
return "p."
|
||||
return default_prefixes
|
||||
|
||||
if (
|
||||
message is not None
|
||||
and message.content is not None
|
||||
and message.content.startswith(self.user.mention)
|
||||
):
|
||||
return default_prefixes
|
||||
|
||||
server_id = server_id if server_id is not None else message.guild.id
|
||||
|
||||
|
||||
@@ -187,8 +187,8 @@ BLOCKED_WORDS = [
|
||||
"footjob",
|
||||
"frotting",
|
||||
"fuck buttons",
|
||||
"fuckin",
|
||||
"fucking",
|
||||
# "fuckin",
|
||||
# "fucking",
|
||||
"fucktards",
|
||||
"fudge packer",
|
||||
"fudgepacker",
|
||||
@@ -510,15 +510,18 @@ BLOCKED_WORDS = [
|
||||
"skeletor",
|
||||
"chunk",
|
||||
"blubber",
|
||||
"skinny",
|
||||
# "skinny",
|
||||
"nigga",
|
||||
"nigger",
|
||||
"nga"
|
||||
"nga",
|
||||
]
|
||||
]
|
||||
|
||||
WORDS = re.compile(r"\w+")
|
||||
PATTERN = re.compile(f"^({"|".join(BLOCKED_WORDS)})$", re.IGNORECASE)
|
||||
PATTERN = re.compile(
|
||||
f"^({"|".join(BLOCKED_WORDS + [word + "s" for word in BLOCKED_WORDS])})$",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
URL_PATTERN = re.compile(r"https?://[^\s]+", re.IGNORECASE)
|
||||
INVITES_PATTERN = re.compile(r"discord.gg/[^\s]+", re.IGNORECASE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user