{ "$schema": "https://metabuilder.dev/schemas/json-script.schema.json", "schemaVersion": "2.2.0", "package": "irc_webchat", "description": "IRC Webchat message handling and command processing functions", "functions": [ { "id": "irc_send_message", "name": "sendMessage", "exported": true, "description": "Send a chat message to a channel", "category": "commands", "luaScript": "send_message.lua", "parameters": [ { "name": "channelId", "type": "string", "description": "Channel identifier" }, { "name": "username", "type": "string", "description": "Username of the sender" }, { "name": "userId", "type": "string", "description": "User identifier" }, { "name": "message", "type": "string", "description": "Message content to send" } ], "returns": { "type": "ChatMessage", "description": "Chat message object" } }, { "id": "irc_handle_command", "name": "handleCommand", "exported": true, "description": "Process IRC commands like /help, /users, /clear, /me", "category": "commands", "luaScript": "handle_command.lua", "parameters": [ { "name": "command", "type": "string", "description": "IRC command string (e.g., /help, /users, /clear, /me )" }, { "name": "channelId", "type": "string", "description": "Channel identifier" }, { "name": "username", "type": "string", "description": "Current username" }, { "name": "onlineUsers", "type": "array", "description": "List of online usernames" } ], "returns": { "type": "IRCMessage", "description": "Response message object" } }, { "id": "irc_format_time", "name": "formatTime", "exported": true, "description": "Format timestamps for display in HH:MM AM/PM format", "category": "formatting", "luaScript": "format_time.lua", "parameters": [ { "name": "timestamp", "type": "number", "description": "Unix timestamp in milliseconds" } ], "returns": { "type": "string", "description": "Formatted time string in HH:MM AM/PM format" } }, { "id": "irc_user_join", "name": "userJoin", "exported": true, "description": "Handle user joining a channel", "category": "events", "luaScript": "user_join.lua", "parameters": [ { "name": "channelId", "type": "string", "description": "Channel identifier" }, { "name": "username", "type": "string", "description": "Username of the user joining" }, { "name": "userId", "type": "string", "description": "User identifier of the user joining" } ], "returns": { "type": "JoinMessage", "description": "Join notification message object" } }, { "id": "irc_user_leave", "name": "userLeave", "exported": true, "description": "Handle user leaving a channel", "category": "events", "luaScript": "user_leave.lua", "parameters": [ { "name": "channelId", "type": "string", "description": "Channel identifier" }, { "name": "username", "type": "string", "description": "Username of the user leaving" }, { "name": "userId", "type": "string", "description": "User identifier of the user leaving" } ], "returns": { "type": "LeaveMessage", "description": "Leave notification message object" } }, { "id": "irc_init", "name": "init", "exported": false, "description": "Lifecycle hooks for installation and removal", "category": "lifecycle", "luaScript": "init.lua" } ], "exports": { "functions": [ "sendMessage", "handleCommand", "formatTime", "userJoin", "userLeave" ] } }