Skip to content

💬 Chat ​

Documentation relating to the spooni_chat.

1. Installation ​

spooni_chat needs spooni_libs (it works alongside your framework through its bridge).

To install spooni_chat:

  • Download the resource
  • Ensure that all requirements are installed
  • Drag and drop the resource into your resources folder
    • spooni_chat
  • Add this ensure in your server.cfg (after spooni_libs and oxmysql)
    bash
    ensure oxmysql
    ensure spooni_libs
    ensure spooni_chat
    
    # OPTIONAL — Discord role tags. Shared with spooni_admin, so you set them once
    # for both. Use "set" (never "sets") so the token stays on the server.
    set spooni_discord_token    "YOUR_BOT_TOKEN"
    set spooni_discord_guild_id "YOUR_DISCORD_SERVER_ID"
  • (Optional) Open server/config_server.lua and paste your Discord webhook / report_webhook URLs to log chat and reports to Discord. Leave them empty to disable logging.
  • Now you can configure and translate the script as you like
    • config.lua
    • language.lua
  • At the end, restart the server, then open /spoonicfg → CHAT SETTINGS → Chat Colours to give each job a chat tag + colour.

TIP

If you also run spooni_admin, the Discord token and guild ID only need to be set once — both scripts read the same convars.

If you have any problems, you can always open a ticket in the Spooni Discord.

2. Usage ​

spooni_chat replaces the default game chat. Players cycle Local, Global and Staff channels, send emojis and photos, and see messages float above the speaker's head in their job's colour and tag. Each player tunes their own chat look — background, scale, font and opacity — with /setchat.

Chat tags per job are managed in /spoonicfg → CHAT SETTINGS, and can optionally come from a player's Discord roles.

Commands ​

CommandWhoDescription
/me /do /tryEveryoneRoleplay actions and dice-style attempts
/whisper /replyEveryonePrivate message a player / answer the last whisper
/setchatEveryoneChange your own chat background, scale, font and opacity
/raportEveryoneSend an in-game report to the staff Discord webhook
/mute /unmute /mutedStaffPersistent global mute and list of muted players
/nickStaffSet a per-player nickname
/play /stopmusicStaffMusic player (requires xsound)

3. For developers ​

Reference

Chat tags, permissions and commands are managed from /spoonicfg → CHAT SETTINGS; these server-side exports back that panel and let other scripts read / write the same data.

lua
-- a player's chat display name (nickname if set, else character name)
local name = exports.spooni_chat:getName(source)

-- read the configured chat ranks / permissions / commands
local ranks = exports.spooni_chat:GetChatRanks()
local perms = exports.spooni_chat:GetChatPerms()
local cmds  = exports.spooni_chat:GetChatCommands()

-- Discord-role chat tags + the guild roles available to map
local dranks = exports.spooni_chat:GetChatDiscordRanks()
local groles = exports.spooni_chat:GetChatGuildRoles()

-- save / delete (used by the CHAT SETTINGS panel)
exports.spooni_chat:SaveChatRank(rank)
exports.spooni_chat:DeleteChatRank(job)
exports.spooni_chat:SaveChatPerms(perms)
exports.spooni_chat:SaveChatCommands(cmds)
exports.spooni_chat:SaveChatDiscordRank(rank)
exports.spooni_chat:DeleteChatDiscordRank(role)