@@ -243,25 +243,26 @@ async def post_mystbin_content(self, contents: list[tuple[str, str]]) -> str:
243
243
async def find_badbins (self , message : discord .Message ) -> None :
244
244
matches = self .BADBIN_RE .findall (message .content )
245
245
246
- if matches :
247
- contents : list [tuple [str , str ]] = []
246
+ if not matches :
247
+ return
248
+
249
+ contents : list [tuple [str , str ]] = []
248
250
249
- for match in matches :
250
- site , slug , ext = match
251
+ for match in matches :
252
+ site , slug , ext = match
251
253
252
- if site is None or slug is None :
253
- continue
254
+ if site is None or slug is None :
255
+ continue
254
256
255
- contents .append ((await self .pull_badbin_content (site , slug ), f"migrated.{ ext or 'txt' } " ))
257
+ contents .append ((await self .pull_badbin_content (site , slug ), f"migrated.{ ext or 'txt' } " ))
256
258
257
- if contents :
258
- key , notice = await self .post_mystbin_content (contents )
259
- msg = f"I've detected a badbin and have uploaded your pastes here: https://mystb.in/{ key } "
259
+ if not contents :
260
+ return
260
261
261
- if notice :
262
- msg += " \n notice: " + notice
262
+ key = await self . post_mystbin_content ( contents )
263
+ msg = f"I've detected a badbin and have uploaded your pastes here: https://mystb.in/ { key } "
263
264
264
- await message .reply (msg , mention_author = False )
265
+ await message .reply (msg , mention_author = False )
265
266
266
267
@commands .Cog .listener ()
267
268
async def on_papi_dpy_modlog (self , payload : ModLogPayload , / ) -> None :
0 commit comments