Discarpet
A Carpet extension for discord bot functionality

This is an extension for fabric-carpet that adds parts of the Discord bot API as scarpet functions.
This allows you to code Discord bots that run within Minecraft, and interact with the Minecraft world.
Requires Carpet mod
How to Install Carpet Discarpet (Mod)
Carpet Discarpet by replaceitem is verified for Fabric across Minecraft versions 1.17, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3 (latest release: 1.7.7, file size: 8.5 MB). Follow the steps below to install it safely from ModCraft.tv:
- Click the Download button above and select your Minecraft version (1.17, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3) and platform (Fabric).
- Make sure you have the compatible loader or environment installed for Fabric.
- Move the downloaded Carpet Discarpet file into your Minecraft
.minecraft/modsfolder and launch the game.
All Versions
+ Add Version| Name | Game version | Platforms | Published | Downloads | Actions |
|---|---|---|---|---|---|
|
R
1.7.7
|
1mo ago | 1 | |||
|
R
1.7.6
|
4mo ago | 1 | |||
|
R
1.7.5
|
5mo ago | 1 | |||
|
R
1.7.4
|
7mo ago | 1 | |||
|
R
1.7.3
|
7mo ago | 1 | |||
|
R
1.7.2
|
9mo ago | 1 | |||
|
R
1.7.1
|
11mo ago | 1 | |||
|
R
1.7.0
|
11mo ago | 1 | |||
|
R
1.6.1
|
last yr. | 1 | |||
|
R
1.6.0
|
last yr. | 1 | |||
|
R
1.5.6
|
last yr. | 1 | |||
|
R
1.5.5
|
last yr. | 1 | |||
|
R
1.5.5
|
last yr. | 1 | |||
|
R
1.5.4
|
last yr. | 1 | |||
|
R
1.5.3
|
last yr. | 1 | |||
|
R
1.5.2
|
last yr. | 1 | |||
|
R
1.5.1
|
last yr. | 1 | |||
|
R
1.5.0
|
last yr. | 1 | |||
|
R
1.4.9
|
last yr. | 1 | |||
|
R
1.4.8
|
last yr. | 1 | |||
|
R
1.4.7
|
last yr. | 1 | |||
|
R
1.4.6
|
last yr. | 1 | |||
|
R
1.4.5
|
last yr. | 1 | |||
|
R
1.4.4
|
last yr. | 1 | |||
|
R
1.4.3
|
last yr. | 1 | |||
|
R
1.4.2
|
last yr. | 1 | |||
|
R
1.4.1
|
last yr. | 1 | |||
|
R
1.4.0
|
last yr. | 1 | |||
|
R
1.3.2
|
last yr. | 1 |
- Added
image_descriptionandthumbnail_descriptionto the embed schema - Added
file_typesoption for attachment slash command option and file upload component
- Updated to MC 26.2
- Reworked bot connection. Behavior may vary.
- Added
CONNECT_TIMEOUTconfig option for adjusting the bot connection timeout. Defaults to 10 seconds.
- Updated to MC 26.1
- Added support for checkbox, checkbox group and radio group components
- Updated modal examples with new components
- Fixed compatibility of
__on_system_messsageevent with other mods like better-fabric-console - Updated JDA version
- Updated to Minecraft 1.21.11
- Updated to JDA 6.1.1. With that comes some breaking changes. See "Migrating" section below for necessary migrations
### Components
- Added new Label component type
- This replaces the use of Action rows in modals and the
labelproperty in text inputs - Action rows are now its own component type
- Instead of the
componentsin the message content schema being a list of lists of components,
action_row.The old syntax of defining an action row from an array is still supported for backward compatibility and convenience.
- The
labelfield of text inputs has been removed. Use a label component instead. - Added support for components V2 via
use_components_v2in message content - Added new components from components V2 (See docs for details)
- Separator
- Container
- Text display
- Section
- Thumbnail
- Media gallery
- File display
- File upload
### Documentation
- Message components example was split into seperate buttons and select menus example
- Added misc components example for component V2 components
- Added links to relevant examples to docs for functions and schemas
- Updated modal example with file upload and select menu
## Migrating
To migrate your scripts, the following is necessary:
- Converting action rows in modals to labels
- Check the updated modal example in the documentation
- Improved handling of error messages of api_exceptions based on JDA exceptions
this mod migrated to JDA, which meant that introducing breaking changes was inevitable,
so I chose to use this update to add more improvements that introduce breaking changes.
The naming convention of "parsables" in the documentation and changelogs have changed.
These map values used as function parameters are now referred to as "schemas" or "objects".
A "schema" is the format of the fields a parsable has,
while an "object" will be referred to as a map value following that schema.
## Breaking changes
The following changes may break existing scripts.
Make sure to update them to work with this new discarpet version.
### Event changes
Due to JDA having no built-in message caching, the following events were changed:
- The
__on_discord_message_editevent now no longer provides the previous message and whether it was actually edited - The
__on_discord_message_deletenow only gives the deleted message id and the channel object instead of the message object
### Function changes
- The channel or message for creating a thread is no longer provided in the schema (*previously "parsable"*), but as an argument to
dc_create_thread dc_reacthas been split todc_add_reaction(msg, emoji)anddc_remove_reaction(msg, emoji?, user?)dc_set_channel_topicwas removed in favor of the newdc_update_channel- Removed
dc_get_display_namein favor ofmember~'effective_name' - Removed
dc_get_timeoutin favor ofmember~'timeout_end' - Removed
dc_get_user_colorin favor ofmember~'color' - Removed
dc_get_user_rolesin favor ofmember~'roles' - Added
dc_update_presence()to replacedc_set_status()anddc_set_activity()
### Value changes
- The command value types are now all the same value type
dc_commandand can be distinguished withcommand~'type' - Removed
user~'discriminated_name, since discriminators are phased out by discord - Replaced
reaction~'message'withreaction~'message_id'since messages are not cached anymore slash_command_interaction~'arguments'andslash_command_interaction~'arguments_by_name'
Additionally,
slash_command_interaction_option~'options' was removed,since subcommand groups and subcommands are no longer expressed as nested options,
but can be retrieved using
interaction~'sub_command' or ~'sub_command_group'.- Replaced
~'is_subcommand_or_group'in slash command interaction option values with~'type'
### Schema changes
- Replaced
threadschemachannel_typewithis_private. - Changes to message content schema
- Renamed
reply_totoreferenced_messagesince it can now also used to forward messages - Added
message_reference_typewhich can be set toforwardto forward messages instead of replying - Made
contentfield optional for messages without content, like forwarded messages
- Updated to 1.21.5
- New behaviour for errors while executing API requests.
true or false (sometimes null or a value)to indicate success or failure. Now those functions no longer return anything
(or only return a value) and instead throw custom discarpet exceptions that can be caught using
try().This affects the following functions and queries:
- These functions no longer return a boolean value to indicate success
dc_set_channel_topicdc_reactdc_set_nicknamedc_add_roledc_remove_roledc_set_namedc_delete- These functions will now throw an exception instead of returning null. When successful they will return a value:
dc_send_messagedc_send_webhookdc_create_webhookdc_update_webhookdc_create_threaddc_create_application_commanddc_get_global_application_commandsdc_user_from_iddc_message_from_iddc_webhook_from_iddc_webhook_from_url- These actions now properly handle errors and throw exceptions on failure:
attachment~'download'channel~'webhooks'server~'webhooks'server~'slash_commands'user~'private_channel'- Special cases:
dc_respond_interactioncan still returnnullwhen the response type doesn't create a message. In all other cases it will either throw an exception or return aMessage- Added events:
__on_discord_message(message, old_message, is_actual_edit)__on_discord_message_delete(message)__on_discord_server_member_join(server, user)__on_discord_server_member_leave(server, user)- Fully removed the deprecated function
dc_create_slash_command. Usedc_create_application_commandinstead - Improved reloading of bots
- Split
dc_timeoutintodc_get_timeoutanddc_set_timeout
- Fixed errors on Minecraft 1.21.3
- Update to Minecraft 1.20.5
- Updated to MC 1.20.4
- Added new sticker value type
- Added dc_sticker_from_id(stickerId)
- Added new query options:
message~'webhook_id'emoji~'id'server~'emojis'server~'stickers'message~'sticker_ids'- Added
stickersfield to message content parsable