Skip to content

PLUGINS EVENT MESSENGER FRIEND REQUEST

github-actions[bot] edited this page Jul 29, 2026 · 1 revision

Plugin Event: messenger.friend.request

This cancellable event runs after player lookup, privacy, duplicate, and both friend-capacity checks, immediately before request persistence.

host.Events().Listen(event.FriendRequestName, event.ListenerOptions{}, func(_ context.Context, current event.Event) error {
	request := current.(*event.FriendRequest)
	request.SetCancelled(accountTooNew(request.Sender.ID))
	return nil
})

Sender and Target are immutable player snapshots. Cancellation does not create the request.

Clone this wiki locally