We are now verified! Husqy is now a verified bot in Discord making us visible in the app discovery and enabling bigger trust to users!
Want to help us translate the Husqy responses? We can't do it without you! Please visit our translations repo!
Skip to main content

Husqy API reactionroles module

General

Endpoints related to general Husqy Modules Reactionroles.

GET - /modules/reactionroles/

Home endpoint for the Modules Reactionroles Husqy API. Returns only success message displaying that it is the Modules Reactionroles Husqy API route.

DELETE - /modules/reactionroles/delete

Delete all panels and reactionrole entries for a specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to delete the settings from

Possible errors:

  • BadRequestError

Status

Endpoints related to the status of the module

GET - /modules/reactionroles/status

Get the status of the reactionroles module for the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to check the status of

Possible errors:

  • BadRequestError
  • SettingsError
POST - /modules/reactionroles/enable

Endpoint to enable the reactionroles module for the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to enable the reactionroles module for

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleEnabledError
  • DatabaseError
POST - /modules/reactionroles/disable

Endpoint to disable the reactionroles module for the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to disable the reactionroles module for

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • DatabaseError

Panels

Endpoints related to reactionrole panels

GET - /modules/reactionroles/panels

Returns a list of reactionrole panels for the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the reactionrole panels from
pagenointegerThe page number to get (default = 1)
page_sizenointegerThe amount of panels to return in one page (default = 10)

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
POST - /modules/reactionroles/panels

Endpoint to create a new reactionrole panel in a guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to create the reactionrole in
is_registeryesbooleanWether the message to use for the reactionrole panel already exists. Note: when registering an existing message, panel_type can only be "emoji"
channel_idyesintegerThe ID of the channel where the message is or will be located
limit_roles_to_oneyesbooleanWether the roles a member can claim via the panel is only based on one entry (entries with multiple roles will give all roles for that entry)
supports_removeyesbooleanWether the panel supports removal of entries from users when reacting/removing reactions
remove_roles_from_users_on_entry_deleteyesbooleanWether the roles for an entry should be removed from a user when the entry gets deleted
panel_typeyesstringThe type of the panel. Can be: "emoji", "button" or "dropdown"
keep_counter_at_oneyes (when panel_type is "emoji")booleanWether the emoji counter should be kept at one
delete_unrelated_emoji_reactionsyes (when panel_type is "emoji")booleanWether other emojis not registered to the panel should be removed
register_message_idyes (when is_register is True)integerThe ID of the existing message to use as the panel
is_embedyes (when is_register is False)booleanWether the message content is an embed json config
contentyes (when is_register is False)stringThe content to use for the message. Can also be embed json config if is_embed is True

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • DiscordApiInteractionError
  • DatabaseError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
GET - /modules/reactionroles/panel/{reactionrole_panel_id}

Returns a details of the specified reactionrole panel in the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the specified reactionrole panel details from

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
DELETE - /modules/reactionroles/panel/{reactionrole_panel_id}

Deletes the specified reactionrole panel and all related reactionrole entries from the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the specified reactionrole panel to delete is located

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
  • ModuleDisabledError
  • DatabaseError
PUT - /modules/reactionroles/panel/{reactionrole_panel_id}

Edit the settings of the specified reactionrole panel in the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the specified reactionrole panel to delete is located
panel_typeyesstringThe new type of the reactionrole panel. Can be: "emoji", "button" or "dropdown"
limit_roles_to_oneyesbooleanThe new setting for limit roles to one
supports_removeyesbooleanThe new setting for supports remove
remove_roles_from_users_on_entry_deleteyesbooleanThe new setting for remove roles from users on entry delete
keep_counter_at_oneyes (when panel_type is "emoji")booleanThe new setting for keep counter at one
delete_unrelated_emoji_reactionsyes (when panel_type is "emoji")booleanThe new setting for delete unrelated emoji reactions
message_contentyesstringThe new message content. Required but can be None if the message is not an Husqy created message
message_is_embedyesbooleanIf the new message content is an embed json config. Required but will not have any effect if the message is not an Husqy created message

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
  • ModuleDisabledError
  • DatabaseError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},

Reactionrole entries

Endpoints to check reactionrole entries for a panel.

GET - /modules/reactionroles/panel/{reactionrole_panel_id}/entries

Returns a list of reactionrole entries added to the reactionrole panel in the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the panel is located

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
POST - /modules/reactionroles/panel/{reactionrole_panel_id}/entries

Endpoint to create a new reactionrole entry for a panel in a guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to create the reactionrole in
role_idsyeslistA list of role ID's to give to the users when reacting
emoji_nameyesstringThe literal emoji, f.e. 😁 or the name of the emoji when it is a custom guild emoji
emoji_idyesintegerThe ID of the custom emoji. When using a default emoji, this can be None
textyesstringThe label text of the button or dropdown item. Can be None when the panel is an emoji panel or button panel. Required for a dropdown panel
descriptionyesstringThe description text of the dropdown item. Can be None.

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • DatabaseError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
GET - /modules/reactionroles/panel/{reactionrole_panel_id}/entries/{reactionrole_entry_id}

Returns the details of a reactionrole entry added to the reactionrole panel in the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the panel is located

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
DELETE - /modules/reactionroles/panel/{reactionrole_panel_id}/entries/{reactionrole_entry_id}

Endpoint to delete the reactionrole entry from the panel in a guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to create the reactionrole in

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • DatabaseError
PUT - /modules/reactionroles/panel/{reactionrole_panel_id}/entries/{reactionrole_entry_id}

Endpoint to edit the reactionrole entry for the panel in a guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to create the reactionrole in
role_idsyeslistThe new list of role ID's to link to the reactionrole entry
textyesstringThe new label for the button or dropdown. Can be None when panel type is emoji or button. Required for panel type dropdown
descriptionyesstringThe new description to show in the dropdown for this entry. Can be None

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • DatabaseError

Checking entries

Endpoints to check entries for adding or deleting

POST - /modules/reactionroles/check
danger

Do not use this endpoint yourself! Roles will be added by Husqy when needed.

Endpoint to handle the interaction with a reactionrole panel (entry).

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the interaction takes place
message_idyesintegerThe ID of the message that is interacted with
message_idyesintegerThe ID of the message to which is reacted
channel_idyesintegerThe ID of the channel where the interacted with message is located
interaction_typeyesstringThe type of interaction. Can be: "component", "reaction_add" or "reaction_delete"
interaction_custom_idyes (when interaction_type is "component")stringThe custom ID linked to the button or dropdown
interaction_id_tokenyes (when interaction_type is "component")stringThe token of the interaction
application_idyes (when interaction_type is "component")stringThe ID of the application
interaction_valueyes (when interaction_type is "component")stringThe value behind the dropdown item. Can be None for buttons
emoji_nameyes (when interaction_type is NOT "component")stringThe literal emoji f.e. 😁 that is being reacted with or the name of the custom emoji
emoji_idyes (when interaction_type is NOT "component")stringThe ID of the custom emoji. Can be None for a normal emoji.

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError
  • NotFoundError (Custom)
{
"success": False,
"data": {},
"error": {
"code": 404,
"message": "Not Found! {reason}",
},
},
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 404,
"message": "Unprocessable Entity! {reason}",
},
},
POST - /modules/reactionroles/panel/check-delete
danger

Do not use this endpoint yourself! Panels will automatically be delete by Husqy when the channel or message that is the panel get deleted.

Endpoint to check if a deleted message is or a deleted channel has a reactionrole panel.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the specified reactionrole entry to delete is located
channel_idyesintegerThe ID of the channel which is deleted or where the deleted message is located
message_idyesintegerThe ID of the message which is deleted. Can be None when a channel gets deleted

Possible errors:

  • BadRequestError
  • SettingsError
  • ModuleDisabledError
  • InternalServerError

Privacy

Endpoints related to privacy and the tags module

GET - /modules/reactionroles/privacy/get-user-entries
danger

Do not use this endpoint yourself! This endpoint will be used by Husqy's Privacy configurator (/privacy) command.

Endpoint to get the amount of references in reactionroles to your user.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the specified references in
privacy_member_idyesintegerThe ID of the member who wants to check their references

Possible errors:

  • BadRequestError
  • ForbiddenError
  • InternalServerError
DELETE - /modules/reactionroles/privacy/delete-user-entries
danger

Do not use this endpoint yourself! This endpoint will be used by Husqy's Privacy configurator (/privacy) command.

Endpoint to delete the references in reactionroles to your user.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to delete the specified references in
privacy_member_idyesintegerThe ID of the member who wants to remove their references

Possible errors:

  • BadRequestError
  • ForbiddenError
  • InternalServerError