mirror of
https://github.com/solero/houdini.git
synced 2025-04-28 09:36:27 +00:00
Fix StopIteration exception thrown when chat_filter_words
is empty
This commit is contained in:
parent
c02b6e164d
commit
7af9344a00
@ -25,6 +25,7 @@ async def handle_send_message(p, penguin_id: int, message: str):
|
|||||||
await penguin.send_xt("mm", message, penguin_id)
|
await penguin.send_xt("mm", message, penguin_id)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if p.server.chat_filter_words:
|
||||||
tokens = message.lower().split()
|
tokens = message.lower().split()
|
||||||
|
|
||||||
word, consequence = next(((w, c) for w, c in p.server.chat_filter_words.items() if w in tokens))
|
word, consequence = next(((w, c) for w, c in p.server.chat_filter_words.items() if w in tokens))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user