Skip to content

Loader

This page documents hooks in the loader category.


DatabaseConnected()View Source

Purpose

Runs after the database connection succeeds and database tables are loaded.

Category

Loader

Realm

Server

Example Usage

  hook.Add("DatabaseConnected", "liaExampleDatabaseConnected", function()
      print("[MyModule] handled DatabaseConnected")
  end)

DiscordRelayed(embed)View Source

Purpose

Runs after the Discord relay request has been dispatched.

Category

Loader

Realm

Shared

Parameters

table embed The embed payload that was dispatched.

Example Usage

  hook.Add("DiscordRelayed", "liaExampleDiscordRelayed", function(embed)
      print("[MyModule] handled DiscordRelayed")
  end)

DiscordRelaySend(embed)View Source

Purpose

Runs before a Discord relay embed is dispatched through the configured webhook.

Category

Loader

Realm

Shared

Parameters

table embed The embed payload being prepared for relay.

Example Usage

  hook.Add("DiscordRelaySend", "liaExampleDiscordRelaySend", function(embed)
      print("[MyModule] handled DiscordRelaySend")
  end)

DiscordRelayUnavailable()View Source

Purpose

Runs when the Discord relay cannot use the CHTTP send path and falls back to the HTTP send path.

Category

Loader

Realm

Shared

Example Usage

  hook.Add("DiscordRelayUnavailable", "liaExampleDiscordRelayUnavailable", function()
      print("[MyModule] handled DiscordRelayUnavailable")
  end)

PersistenceLoad(new)View Source

Purpose

Runs after map cleanup when the `sbox_persist` console variable changes to a non-empty value.

Category

Loader

Realm

Server

Parameters

string new The new persistence value being loaded.

Example Usage

  hook.Add("PersistenceLoad", "liaExamplePersistenceLoad", function(new)
      print("[MyModule] handled PersistenceLoad")
  end)

SetupDatabase()View Source

Purpose

Runs immediately before the server begins connecting to the configured database.

Category

Loader

Realm

Server

Example Usage

  hook.Add("SetupDatabase", "liaExampleSetupDatabase", function()
      print("[MyModule] handled SetupDatabase")
  end)