fix(bot): 🐛 Fix censorship.
This commit is contained in:
+7
-1
@@ -243,6 +243,9 @@ class Payphone(commands.AutoShardedBot):
|
||||
if message is not None and message.guild is None:
|
||||
return ["p.", "P."]
|
||||
|
||||
if message is not None and message.content is None:
|
||||
return "p."
|
||||
|
||||
server_id = server_id if server_id is not None else message.guild.id
|
||||
|
||||
key = constants.PREFIX_TEMPLATE % server_id
|
||||
@@ -259,7 +262,7 @@ class Payphone(commands.AutoShardedBot):
|
||||
|
||||
prefix = server.prefix
|
||||
|
||||
if message.content.lower().startswith(prefix.lower()):
|
||||
if message is not None and message.content.lower().startswith(prefix.lower()):
|
||||
return message.content[: len(prefix)]
|
||||
|
||||
return prefix
|
||||
@@ -375,6 +378,9 @@ async def is_channel_enabled(ctx: commands.Context) -> Literal[True]:
|
||||
|
||||
if ctx.guild is None:
|
||||
return True
|
||||
|
||||
if ctx.command.qualified_name in ["config enable", "config disable"]:
|
||||
return True
|
||||
|
||||
server_id = ctx.guild.id
|
||||
channel_id = ctx.channel.id
|
||||
|
||||
Reference in New Issue
Block a user