Skip to content
Francisco Dias edited this page Dec 18, 2024 · 3 revisions

Events

Functions

This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.



Back To Top

modio_events_get_list

mod.io Endpoint: Get Mods Events


This function gets all mods events for the corresponding game sorted by latest event first. A successful request will return an array of ModEvent structs.

Note

We recommend you poll this endpoint to keep mods up-to-date. If polling this endpoint for updates, you should store the id or date_added of the latest event, and on subsequent requests use that information in the filter, to return only newer events to process.

Filters:

  • id (real) Unique id of the event object.

  • mod_id (Real) Unique id of the parent mod.

  • user_id (Real) Unique id of the user who performed the action.

  • date_added (Real) Unix timestamp of date mod event occurred.

  • event_type (String) Type of change that occurred:

    • "MODFILE_CHANGED" = Live file changed
    • "MOD_AVAILABLE" = Mod is marked as accepted and public
    • "MOD_UNAVAILABLE" = Mod is marked as not accepted, deleted or hidden
    • "MOD_EDITED" = The mod was updated (triggered when any column value changes)
    • "MOD_DELETED" = The mod has been permanently erased. This is an orphan record, looking up this id will return no data
    • "MOD_TEAM_CHANGED" = A user has joined or left the mod team
    • "MOD_COMMENT_ADDED" = A comment has been published for a mod
    • "MOD_COMMENT_DELETED" = A comment has been deleted from a mod
  • latest (Bool) Default value is true. Returns only the latest unique events, which is useful for checking if the live modfile has changed.

  • subscribed (Bool) Default value is false. Returns only events connected to mods the authenticated user is subscribed to, which is useful for keeping the user's mods up-to-date.


Syntax:

modio_events_get_list(_callback_success, _callback_failed, _game_id)
Argument Type Description
_callback_success Function or Method The function to trigger when the request is successful.
_callback_failed Function or Method The function to trigger when the request failed.
_game_id Real OPTIONAL The ID of the game, defaults to the value set in the Game ID extension option if not provided



Returns:

GetModEvents




Back To Top

modio_events_get

mod.io Endpoint: Get Mod Events


This function gets the event log for a mod, showing changes made sorted by latest event first. A successful request will return an array of ModEvent structs. It's recommended to read the filtering documentation to return only the records you want.


Syntax:

modio_events_get(_mod_id, _callback_success, _callback_failed, _game_id)
Argument Type Description
_mod_id Real Unique id of the mod.
_callback_success Function or Method The function to trigger when the request is successful.
_callback_failed Function or Method The function to trigger when the request failed.
_game_id Real OPTIONAL The ID of the game, defaults to the value set in the Game ID extension option if not provided



Returns:

GetModEvents



Clone this wiki locally