|
91 | 91 | }
|
92 | 92 |
|
93 | 93 |
|
94 |
| -class PGCActivityCog(BaseExtensionCog, name="pgc-activity"): |
95 |
| - def __init__(self, bot: BotT, theme_color: int | discord.Color = 0) -> None: |
| 94 | +class PGCCog(BaseExtensionCog, name="pgc"): |
| 95 | + def __init__( |
| 96 | + self, |
| 97 | + bot: BotT, |
| 98 | + theme_color: int | discord.Color = 0, |
| 99 | + honeypot_channel_id: int | None = None, |
| 100 | + ) -> None: |
96 | 101 | super().__init__(bot, theme_color)
|
| 102 | + self.honeypot_channel_id = honeypot_channel_id |
| 103 | + self.honeypot_victims = set() |
97 | 104 |
|
98 | 105 | @commands.Cog.listener()
|
99 | 106 | async def on_ready(self):
|
@@ -136,6 +143,17 @@ async def on_message(self, message: discord.Message):
|
136 | 143 | ):
|
137 | 144 | return
|
138 | 145 |
|
| 146 | + if message.channel.id == self.honeypot_channel_id: |
| 147 | + await message.guild.ban( |
| 148 | + message.author, reason="Fell into snake pit", delete_message_days=1 |
| 149 | + ) |
| 150 | + |
| 151 | + if message.author.id not in self.honeypot_victims: |
| 152 | + self.honeypot_victims.add(message.author.id) |
| 153 | + await message.guild.unban(message.author, reason="Second chance") |
| 154 | + else: |
| 155 | + self.honeypot_victims.remove(message.author.id) |
| 156 | + |
139 | 157 | if message.type == discord.MessageType.premium_guild_tier_1:
|
140 | 158 | await message.channel.send(
|
141 | 159 | "LETS GO 🎉 ! Thanks for boosting us to **LEVEL 1** "
|
@@ -191,5 +209,5 @@ async def on_member_join(self, member: discord.Member):
|
191 | 209 |
|
192 | 210 |
|
193 | 211 | @snakecore.commands.decorators.with_config_kwargs
|
194 |
| -async def setup(bot: BotT): |
195 |
| - await bot.add_cog(PGCActivityCog(bot)) |
| 212 | +async def setup(bot: BotT, honeypot_channel_id: int | None = None) -> None: |
| 213 | + await bot.add_cog(PGCCog(bot, honeypot_channel_id=honeypot_channel_id)) |
0 commit comments