Skip to content

Commit 06bccf5

Browse files
committed
Change userbot yeeter behavior for new methods
1 parent 44c278e commit 06bccf5

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

cogs/events.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ async def invite_spam_pop(self, message: discord.Message):
5353
await asyncio.sleep(40)
5454
self.invite_antispam[message.author.id].remove(message)
5555
try:
56-
if len(self.userbot_yeeter[message.author.id]) == 0:
57-
self.userbot_yeeter.pop(message.author.id)
56+
if len(self.invite_antispam[message.author.id]) == 0:
57+
self.invite_antispam.pop(message.author.id)
5858
except KeyError:
5959
pass
6060

@@ -212,25 +212,6 @@ async def scan_message(self, message: discord.Message, is_edit=False):
212212
await message.delete()
213213
except discord.errors.NotFound:
214214
pass
215-
216-
if message.author.id not in self.userbot_yeeter:
217-
self.userbot_yeeter[message.author.id] = []
218-
if message.channel not in self.userbot_yeeter[message.author.id]:
219-
self.userbot_yeeter[message.author.id].append(message.channel)
220-
if len(self.userbot_yeeter[message.author.id]) == 2:
221-
if isinstance(message.author, discord.Member):
222-
msg = ("You have been banned from Nintendo Homebrew for linking scamming sites in multiple channels. "
223-
"If you think this is a mistake contact <@159824269411352576> (frozenchen) on discord or send a email to staff@nintendohomebrew.com")
224-
await send_dm_message(message.author, msg)
225-
self.bot.actions.append(f'wk:{message.author.id}')
226-
await message.author.kick(reason="Linking scamming links in multiple channels.")
227-
try:
228-
await message.delete()
229-
except discord.errors.NotFound:
230-
pass
231-
return
232-
else:
233-
self.bot.loop.create_task(self.userbot_yeeter_pop(message))
234215
await self.bot.restrictions.add_restriction(message.author, Restriction.Probation, reason="Linking scamming site")
235216
if isinstance(message.author, discord.Member):
236217
try:
@@ -252,6 +233,28 @@ async def scan_message(self, message: discord.Message, is_edit=False):
252233
f"See {self.bot.channels['message-logs'].mention} for the deleted message. @here",
253234
allowed_mentions=discord.AllowedMentions(everyone=True))
254235

236+
# Kick members that post messages with multiple images in multiple channels
237+
if len(message.attachments) > 3:
238+
if message.author.id not in self.userbot_yeeter:
239+
self.userbot_yeeter[message.author.id] = []
240+
if message.channel not in self.userbot_yeeter[message.author.id]:
241+
self.userbot_yeeter[message.author.id].append(message.channel)
242+
if len(self.userbot_yeeter[message.author.id]) == 3:
243+
if isinstance(message.author, discord.Member):
244+
msg = (
245+
"You have been banned from Nintendo Homebrew for suspicious behavior in multiple channels. "
246+
"If you think this is a mistake contact <@159824269411352576> (frozenchen) on discord or send a email to staff@nintendohomebrew.com")
247+
await send_dm_message(message.author, msg)
248+
self.bot.actions.append(f'wk:{message.author.id}')
249+
await message.author.kick(reason="Suspiscious behavior in multiple channels.")
250+
try:
251+
await message.delete()
252+
except discord.errors.NotFound:
253+
pass
254+
return
255+
else:
256+
self.bot.loop.create_task(self.userbot_yeeter_pop(message))
257+
255258
# Disabled due to automod taking over this task
256259
# # check for mention spam
257260
# if len(message.mentions) >= 6:

0 commit comments

Comments
 (0)