LibertyCode
LibertyCode
  • Welcome
  • lc_adminmenu
    • Introduction
    • Installation
    • Avatars
    • Screenshots
    • Bridge
      • Server
      • Client
    • Player functions
    • Permissions
      • Permission Groups
      • Discord Permissions
    • Exports
Powered by GitBook
On this page
  • SendDiscordLog
  • GetDiscordAvatarFromId
  • GetIdentifiersEmbedField
  • SendPlainDiscordWebhook
  1. lc_adminmenu

Discord functions

Last updated 1 year ago

SendDiscordLog

SendDiscordLog(type, title, description, player_id, admin_id)

Parameters:

  • type: string - Webhook URL name from webhook_urls.lua

  • title: string

  • description: string

  • player_id: number

  • admin_id: number

Example:

SendDiscordLog('kick', 'Player kicked', ('Reason: %s'):format(reason), target_id, admin_id)

GetDiscordAvatarFromId

Returns discord avatar URL from cache.

GetDiscordAvatarFromId(targetId)

Parameters:

  • targetId: number

Returns: string

GetIdentifiersEmbedField

Used for default discord logging, it returns embed field object with identifiers, It mentions player on discord.

GetIdentifiersEmbedField(identifiers, field_name, inline)

Parameters:

  • identifiers: string[]

  • field_name: string

  • inline: boolean

Returns:

  • name: string

  • value: string

  • inline: boolean

SendPlainDiscordWebhook

SendPlainDiscordWebhook(type, data)

Parameters:

  • type: string - Webhook URL name from webhook_urls.lua

data - Discord webhook params.

https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params