Skip to content

Commit e68874f

Browse files
committed
Fix condition causing honeypot to not work in 'pgc' extension
1 parent 54420cd commit e68874f

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

pcbot/exts/bot_management.py

+18-12
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ async def on_command(self, ctx: commands.Context[BotT]):
146146
name=f"{ctx.author}",
147147
icon_url=f"{ctx.author.avatar or ctx.author.default_avatar}",
148148
),
149-
description=escaped_cmd_text
150-
if len(escaped_cmd_text) <= 4095
151-
else escaped_cmd_text[:2044] + "...",
149+
description=(
150+
escaped_cmd_text
151+
if len(escaped_cmd_text) <= 4095
152+
else escaped_cmd_text[:2044] + "..."
153+
),
152154
fields=[
153155
dict(
154156
name="\u200b",
@@ -232,9 +234,11 @@ async def on_command(self, ctx: commands.Context[BotT]):
232234
if is_unknown_error
233235
else "Failed ❌"
234236
),
235-
color=constants.UNKNOWN_COMMAND_ERROR_COLOR
236-
if is_unknown_error
237-
else constants.KNOWN_COMMAND_ERROR_COLOR,
237+
color=(
238+
constants.UNKNOWN_COMMAND_ERROR_COLOR
239+
if is_unknown_error
240+
else constants.KNOWN_COMMAND_ERROR_COLOR
241+
),
238242
)
239243
),
240244
attachments=invocation_log_message.attachments
@@ -536,12 +540,14 @@ async def eval(self, ctx: commands.Context[BotT], code: CodeBlock):
536540
),
537541
color=int(self.theme_color),
538542
),
539-
file=discord.File(
540-
io.StringIO(repr(eval_output)), # type: ignore
541-
filename=f"eval_output_{datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.txt",
542-
)
543-
if len(eval_output) > 4096
544-
else None,
543+
file=(
544+
discord.File(
545+
io.StringIO(repr(eval_output)), # type: ignore
546+
filename=f"eval_output_{datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.txt",
547+
)
548+
if len(eval_output) > 4096
549+
else None
550+
),
545551
)
546552

547553
@is_bot_manager()

pcbot/exts/pgc.py

-9
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,6 @@ async def on_message(self, message: discord.Message):
127127
if not (
128128
message.guild
129129
and message.guild.id == PGC_GUILD_ID
130-
and (
131-
message.type
132-
in (
133-
discord.MessageType.premium_guild_subscription,
134-
discord.MessageType.premium_guild_tier_1,
135-
discord.MessageType.premium_guild_tier_2,
136-
discord.MessageType.premium_guild_tier_3,
137-
)
138-
)
139130
and message.channel.permissions_for(
140131
message.guild.get_member(self.bot.user.id) # type: ignore
141132
or await message.guild.fetch_member(self.bot.user.id) # type: ignore

0 commit comments

Comments
 (0)