fix chat filtering and puffle item quantity oversights (#114)

* fix chat filtering and puffle item quantity oversights

if a word exists in the database with all parametres set to false, the current implementation will still fail. also adds red bubble messages for mods

the limit for puffles is 75, thus there is no reason to own 100 puffle hats

* fix consequence ordering
This commit is contained in:
JeffTheRock
2026-05-10 00:02:11 -04:00
committed by GitHub
parent bf5f1d6897
commit eac6143f28
2 changed files with 14 additions and 8 deletions

View File

@@ -30,12 +30,15 @@ async def handle_send_message(p, penguin_id: int, message: str):
if consequence is not None:
if consequence.ban:
await p.room.send_xt('mm', message, p.id, f=lambda px: px.moderator)
await moderator_ban(p, p.id, comment='Inappropriate language', message=message)
return
if consequence.warn:
elif consequence.warn:
await p.room.send_xt('mm', message, p.id, f=lambda px: px.moderator)
await moderator_kick(p, p.id)
return
else:
elif consequence.filter:
await p.room.send_xt('mm', message, p.id, f=lambda px: px.moderator)
return
try:

View File

@@ -629,14 +629,17 @@ async def handle_add_puffle_care_item(p, item_id: int):
if care_item_id in p.puffle_items:
penguin_care_item = p.puffle_items[care_item_id]
if penguin_care_item.play_external == "superplay":
if care_item.play_external == "superplay":
return await p.send_error(408)
if penguin_care_item.quantity >= 100:
if penguin_care_item.type == "head":
return await p.send_error(407)
else:
return await p.send_error(406)
max_quantity = 100
error_code = 406
if care_item.type == 'head':
max_quantity = 75
error_code = 407
if penguin_care_item.quantity >= max_quantity:
return await p.send_error(error_code)
await p.add_puffle_item(care_item)