📓GroupPosts

Posts made into Groups / Spaces

The GroupPosts contract is a smart contract that allows managing group posts. It provides functionalities for adding, removing, and retrieving messages that are posted in a group.

Table of Contents


Events

logAddPost

This event is emitted whenever a post is added to a group.

logRemovePost

This event is emitted whenever a post is removed from a group.


Public Functions

getMsgIDsByGroupID

This function can be used to retrieve a list of messages posted in a specific group / space. It provides a mechanism for browsing group messages by starting from a specific index, allowing for efficient navigation through large amounts of posts.

  • Inputs

    Name
    Type
    Description

    groupID

    uint256

    The ID of the group / space to get a list of posts for.

    startFrom

    uint256

    The index from where to start getting records.

  • Outputs

    Name
    Type
    Description

    uint256[]

    An array

    An array of message IDs.

  • Example

    const contract = new ethers.Contract(contractAddress, abi, provider);
    
    let groupID = 1;
    let startFrom = 0;
    
    async function getMsgs() {
        let msgIDs = await contract.getMsgIDsByGroupID(groupID, startFrom);
        console.log('Message IDs: ', msgIDs);
    }
    
    getMsgs();

Last updated