mirror of
https://github.com/solero/houdini.git
synced 2026-05-10 17:38:02 +00:00
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:
@@ -30,12 +30,15 @@ async def handle_send_message(p, penguin_id: int, message: str):
|
|||||||
|
|
||||||
if consequence is not None:
|
if consequence is not None:
|
||||||
if consequence.ban:
|
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)
|
await moderator_ban(p, p.id, comment='Inappropriate language', message=message)
|
||||||
return
|
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)
|
await moderator_kick(p, p.id)
|
||||||
return
|
return
|
||||||
else:
|
elif consequence.filter:
|
||||||
|
await p.room.send_xt('mm', message, p.id, f=lambda px: px.moderator)
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -629,14 +629,17 @@ async def handle_add_puffle_care_item(p, item_id: int):
|
|||||||
if care_item_id in p.puffle_items:
|
if care_item_id in p.puffle_items:
|
||||||
penguin_care_item = p.puffle_items[care_item_id]
|
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)
|
return await p.send_error(408)
|
||||||
|
|
||||||
if penguin_care_item.quantity >= 100:
|
max_quantity = 100
|
||||||
if penguin_care_item.type == "head":
|
error_code = 406
|
||||||
return await p.send_error(407)
|
if care_item.type == 'head':
|
||||||
else:
|
max_quantity = 75
|
||||||
return await p.send_error(406)
|
error_code = 407
|
||||||
|
|
||||||
|
if penguin_care_item.quantity >= max_quantity:
|
||||||
|
return await p.send_error(error_code)
|
||||||
|
|
||||||
await p.add_puffle_item(care_item)
|
await p.add_puffle_item(care_item)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user