mirror of
https://github.com/mt-mods/mail.git
synced 2025-08-24 11:17:17 -04:00
Add API callback specifically for players receiving mail
This commit is contained in:
parent
3046f46414
commit
c7f631664e
3 changed files with 21 additions and 5 deletions
9
api.md
9
api.md
|
@ -34,7 +34,7 @@ local success, error = mail.send({
|
|||
```
|
||||
|
||||
# Hooks
|
||||
On-receive mail hook:
|
||||
Generic on-receive mail hook:
|
||||
|
||||
```lua
|
||||
mail.register_on_receive(function(m)
|
||||
|
@ -42,6 +42,13 @@ mail.register_on_receive(function(m)
|
|||
end)
|
||||
```
|
||||
|
||||
Player-specific on-receive mail hook:
|
||||
```lua
|
||||
mail.register_on_player_receive(function(player, msg)
|
||||
-- "player" is the name of a recipient; "msg" is a mail object (see "Mail format")
|
||||
end)
|
||||
```
|
||||
|
||||
# Recipient handler
|
||||
Recipient handlers are registered using
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue