Server exports
Ban, kick, or unban a player from your own server scripts through Raven, recorded on your dashboard like any other action.
Raven exposes three server-side exports, Ban, Kick, and Unban, so your own resources can act on a player through Raven. Each one records the action on your dashboard exactly like a detection would, so the player shows up in your bans list and stays reviewable.
Ban a player
exports['raven']:Ban(source, reason)
Bans the player on source through Raven. The ban is recorded on your dashboard as a manual ban, the player is dropped with your configured ban message, and a ban id is issued.reason is optional and falls back to Banned by an admin. when omitted. Returns true once the ban is recorded, or false if the player is invalid or already being actioned.
RegisterCommand('banplayer', function(source, args)
local target = tonumber(args[1])
local reason = table.concat(args, ' ', 2)
if target then
exports['raven']:Ban(target, reason)
end
end, true)Kick a player
exports['raven']:Kick(source, reason)
Kicks the player on source through Raven. The kick is recorded on your dashboard and the player is dropped with your configured kick message. reason is optional and falls back to Kicked by an admin. when omitted. Returns true once the kick is recorded, or false if the player is invalid.
exports['raven']:Kick(source, 'Breaking server rules')Unban a player
exports['raven']:Unban(banId, reason)
Removes a ban by its id. Pass the banId shown on the dashboard or returned when the ban was created. The ban is marked as removed, the trust score the ban took is refunded, and the player can connect again. reason is optional. The call is queued and runs against the dashboard, so it returns right away rather than waiting for the result.
exports['raven']:Unban('ban-1718900000000-a1b2c3d', 'Appeal accepted')Parameters
- source is the player server id (a number). A string that looks like a number is accepted too.
- reason is an optional string shown to the player and stored with the record. Leave it off to use the default.
- banId (Unban only) is the id of the ban to remove, the same value shown on your dashboard or returned when the ban was created.