Module extension

Callback registration interface

A client script should implement this module interface to handle callbacks from the client.

The script will be executed with the scripts arguments passed in the 'arg' table. All standard Lua libraries are registered. Client interaction is available through the glirc lirary.

Info:

  • Copyright: Eric Mertens 2018
  • License: ISC
  • Author: Eric Mertens

Functions

stop (self) Callback used by client when unloading the Lua extension.
process_message (self, message) Callback used when client receives message from the server.
process_chat (self, chat) Callback used when client submits a chat message.
process_command (self, command) Callback used when client submits an /extension Lua command

Tables

extension When scripting glirc, the glirc.lua file should return a table with these fields.
command Table used with process_command
chat Table used with process_chat
message Table used with sendmessage and processmessage.
prefix Prefix information for messages being sent or received


Functions

stop (self)
Callback used by client when unloading the Lua extension.

Parameters:

process_message (self, message)
Callback used when client receives message from the server.

Parameters:

Returns:

    bool Return true to drop this message
process_chat (self, chat)
Callback used when client submits a chat message.

Parameters:

  • self extension Extension module
  • chat chat Chat information table

Returns:

    bool Return true to drop this message
process_command (self, command)
Callback used when client submits an /extension Lua command

Parameters:

Tables

extension
When scripting glirc, the glirc.lua file should return a table with these fields. Any omitted field will be ignored during its corresponding event.

process_message is called with a message argument.

process_command is called with a command argument.

Fields:

  • process_message func Function called to process a message
  • process_command func Function called to process a client /extension command
  • process_chat func Function called to process client sending a chat message
  • stop func Function called when unloading this extension
command
Table used with process_command

Fields:

  • command string Argument to the /extension client command
chat
Table used with process_chat

Fields:

message
Table used with sendmessage and processmessage.

Fields:

prefix
Prefix information for messages being sent or received

Fields:

generated by LDoc 1.4.6 Last updated 2018-08-15 13:01:13