9191}
9292
9393
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 :
96101 super ().__init__ (bot , theme_color )
102+ self .honeypot_channel_id = honeypot_channel_id
103+ self .honeypot_victims = set ()
97104
98105 @commands .Cog .listener ()
99106 async def on_ready (self ):
@@ -120,6 +127,7 @@ async def on_message(self, message: discord.Message):
120127 if not (
121128 message .guild
122129 and message .guild .id == PGC_GUILD_ID
130+ and isinstance (message .author , discord .Member )
123131 and (
124132 message .type
125133 in (
@@ -136,6 +144,17 @@ async def on_message(self, message: discord.Message):
136144 ):
137145 return
138146
147+ if message .channel .id == self .honeypot_channel_id :
148+ await message .author .ban (
149+ reason = "Fell into snake pit" , delete_message_days = 1
150+ )
151+
152+ if message .author .id not in self .honeypot_victims :
153+ self .honeypot_victims .add (message .author .id )
154+ await message .author .unban (reason = "Second chance" )
155+ else :
156+ self .honeypot_victims .remove (message .author .id )
157+
139158 if message .type == discord .MessageType .premium_guild_tier_1 :
140159 await message .channel .send (
141160 "LETS GO 🎉 ! Thanks for boosting us to **LEVEL 1** "
@@ -191,5 +210,5 @@ async def on_member_join(self, member: discord.Member):
191210
192211
193212@snakecore .commands .decorators .with_config_kwargs
194- async def setup (bot : BotT ) :
195- await bot .add_cog (PGCActivityCog (bot ))
213+ async def setup (bot : BotT , honeypot_channel_id : int | None = None ) -> None :
214+ await bot .add_cog (PGCCog (bot , honeypot_channel_id = honeypot_channel_id ))
0 commit comments