Comments - modio/modio-sdk-legacy GitHub Wiki
getAllModComments
void Instance::getAllModComments(u32 mod_id, modio::FilterCreator &filter, const std::function<void(const modio::Response &response, const std::vector<modio::Comment>& comments)>& callback);
API endpoint used: Get All Mod Comments
Get all comments posted in the mods profile, can be filtered using the modio::FilterCreator.
Function parameters
Name | Type | Description |
---|---|---|
mod_id | u32 |
Unique id of the mod. |
filter_creator | modio::FilterCreator& |
modio::FilterCreator object to be customized. |
callback | const modio::Response &response, const std::vector<modio::Comment>& comments)>& |
Function called once the process finished. |
Callback parameters
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
comments | const std::vector<modio::Comment>& |
Vector containing the returned comments. |
Example
modio::FilterCreator filter_creator;
filter_creator.setFilterLimit(3);
modio_instance.getAllModComments(mod_id, filter, [&](const modio::Response& response, const std::vector<modio::Comment> & comments)
{
if(response.code == 200)
{
//Mod comments successfully retrieved
}
});
getModComment
void getModComment(u32 mod_id, u32 comment_id, const std::function<void(const modio::Response &response, const modio::Comment &comment)> &callback);
API endpoint used: Get Mod Comment
Get a mod comment by providing it's id.
Function parameters
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
comment_id | u32 |
Comment's unique identifier. |
callback | const std::function<void(const modio::Response& response, const modio::Comment& comment)>& |
Function called once the process finished. |
Callback parameters
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
mod | const modio::Mod& |
Returned mod. |
Example
modio_instance.getModComment(mod_id, comment_id, [&](const modio::Response& response, const modio::Comment& comment)
{
if(response.code == 200)
{
//Mod comment successfully retrieved
}
});
deleteModComment
void Instance::deleteModComment(u32 mod_id, u32 comment_id, const std::function<void(const modio::Response &response)>& callback);
API endpoint used: Delete Mod Comment
Delete a comment from a mod profile.
Function parameters
Name | Type | Description |
---|---|---|
mid_id | u32 |
Unique id of the mod. |
comment_id | u32 |
Unique id of the comment. |
callback | const std::function<void(const modio::Response &response)>& |
Function called once the process finished. |
Callback parameters
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
Example
modio_instance.deleteModComment(mod_id, comment_id, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Mod comment successfully deleted
}
});