Limiit !to to 5 messages per user
This commit is contained in:
parent
2d2ea2fc3a
commit
8a9fedb875
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,10 @@ class Module(ModuleManager.BaseModule):
|
||||||
target_user = event["server"].get_user(event["args_split"][0])
|
target_user = event["server"].get_user(event["args_split"][0])
|
||||||
messages = event["target"].get_user_setting(target_user.get_id(),
|
messages = event["target"].get_user_setting(target_user.get_id(),
|
||||||
"to", [])
|
"to", [])
|
||||||
|
|
||||||
|
if len(messages) == 5:
|
||||||
|
raise utils.EventError("Users can only have 5 messages stored")
|
||||||
|
|
||||||
messages.append([event["user"].nickname,
|
messages.append([event["user"].nickname,
|
||||||
" ".join(event["args_split"][1:]),
|
" ".join(event["args_split"][1:]),
|
||||||
utils.iso8601_format_now()])
|
utils.iso8601_format_now()])
|
||||||
|
|
Loading…
Reference in a new issue