ItsMyStudio

Actions

Learn about all the actions you can use in ItsMyBot to perform various tasks and automate your server management.

Support

The actions are the main part of the bot. They are used to perform actions when a trigger is met. You can find more information about how to use them here.


All Actions

addCoins

Add coins to a user.

Prop

Type

Example
actions:
  - id: addCoins
    args:
      amount: 100 # Amount of coins to add

addInviteBonus

Add bonus invites to a user. Requires the Invite Traker addon.

Prop

Type

Example
actions:
  - id: addInviteBonus
    args:
      amount: 5 # Amount of bonus invites

addReaction

Add a reaction to a message. The reaction can be an emoji or a custom emoji.

Prop

Type

Example
actions:
  - id: addReaction
    args:
      value: "✅"

addRole

Add a role to a member. The role can be a string or an array of strings.

Prop

Type

Example
actions:
  - id: addRole
    args:
      value: "Admin" # Role ID or name
  - id: addRole
    args:
      value:
        - "Admin" # Role ID or name
        - "Moderator" # Role ID or name

addTag

Add a tag to a thread. The tag can be a string or an array of strings.

Prop

Type

Example
actions:
  - id: addTag
    args:
      value: "Tag1" # Tag ID
  - id: addTag
    args:
      value:
        - "Tag1" # Tag ID
        - "Tag2" # Tag ID

closeThread

Close a thread.

Example
actions:
  - id: closeThread

createChannel

Create a channel.

Can triggers follow-up actions

Prop

Type

Example
actions:
  - id: createChannel
    args:
      value: "new-channel" # Channel name, support placeholders & list for random names
      channel-type: "text" # Channel type
      parent: "123456789012345678" # Parent channel ID
      description: "This is a new channel" # Channel description, support placeholders & list for random descriptions
      permission-overwrites:
        - id: "123456789012345678" # Role or user ID
          allow: ["VIEW_CHANNEL"] # Permissions to allow
          deny: ["SEND_MESSAGES"] # Permissions to deny
  - id: createChannel
    args:
      value: "simple" # Channel name, support placeholders & list for random names

createThread

Create a thread in a channel. If made in a forum channel, it will create a forum post. If made in a text channel, it will create a thread.

Can triggers follow-up actions

Prop

Type

Example
actions:
  - id: createThread
    args:
      value: "Hello there !" # Thread name
  - id: createThread
    args:
      value:
        - "Thread 1" # Thread name
        - "Thread 2" # Thread name
      duration: 3600 # Thread auto archive duration in seconds (1 hour)
      private: true # Whether the thread is private or not
      tags: # Thread tags ID, optional (Only for forum posts)
        - "123456789012345678" # Tag ID
        - "234567890123456789" # Tag ID
      components:
        - type: text-display
          content: "This is a forum post" # Required for forum posts

crosspostMessage

Crosspost a message from an announcement channel to other channels.

Example
actions:
  - id: crosspostMessage

deleteChannel

Delete a channel.

Example
actions:
  - id: deleteChannel

deleteMessage

Delete a message.

Example
actions:
  - id: deleteMessage

deleteThread

Delete a thread.

Example
actions:
  - id: deleteThread

editChannel

Edit a channel.

Prop

Type

Example
actions:
  - id: editChannel
    args:
      value: "edited-channel" # Channel name, support placeholders & list for random names
      parent: "123456789012345678" # Parent channel ID
      description: "This is an edited channel" # Channel description, support placeholders & list for random descriptions
      permission-overwrites:
        - id: "123456789012345678" # Role or user ID
          allow: ["VIEW_CHANNEL"] # Permissions to allow
          deny: ["SEND_MESSAGES"] # Permissions to deny
  - id: editChannel
    args:
      value: "simple-edited" # Channel name, support placeholders & list for random names

editMessage

Edit a message. You can see the message configuration for more information.

Prop

Type

Example
actions:
  - id: editMessage
    args:
      components:
        - type: text-display
          content: "Hello there !"

editThread

Edit a thread.

Prop

Type

Example
actions:
  - id: editThread
    args:
      value: "edited-thread" # Thread name, support placeholders & list for random names
      duration: 3600 # Thread auto archive duration in seconds (1 hour)
      tags: # Thread tags ID, optional (Only for forum posts)
        - "123456789012345678" # Tag ID
        - "234567890123456789" # Tag ID
  - id: editThread
    args:
      value: "simple-edited" # Thread name, support placeholders & list for random names

lockThread

Lock a thread. This will prevent users from sending messages in the thread.

Example
actions:
  - id: lockThread

metaAdd

Increase the value of a key in the meta data. Only works with number type.

Prop

Type

Example
actions:
  - id: metaAdd
    args:
      key: "xp" # Key to add the value to
      value: 100 # Value to add

metaListAdd

Add a value to a meta list. Only works with list type.

Prop

Type

Example
actions:
  - id: metaListAdd
    args:
      key: "inventory" # Key to add the value to
      value: "item_1" # Value to add

metaListRemove

Remove a value from a meta list. Only works with list type.

Prop

Type

Example
actions:
  - id: metaListRemove
    args:
      key: "inventory" # Key to remove the value from
      value: # Value to remove
Example
actions:
  - id: metaListRemove
    args:
      key: "inventory" # Key to remove the value from
      value: "item_1" # Value to remove

metaRemove

Remove a value from the meta data.

Prop

Type

Example
actions:
  - id: metaRemove
    args:
      key: "xp" # Key to remove the value from

metaSet

Set a value to a key in the meta data.

Prop

Type

Example
actions:
  - id: metaSet
    args:
      key: "xp" # Key to set the value to
      value: 100 # Value to set

metaSubtract

Decrease the value of a key in the meta data. Only works with number type.

Prop

Type

Example
actions:
  - id: metaSubtract
    args:
      key: "xp" # Key to subtract the value from
      value: 50 # Value to subtract

metaToggle

Toggle a value in the meta data. Only works with boolean type.

Prop

Type

Example
actions:
  - id: metaToggle
    args:
      key: "is_active" # Key to toggle the value for

openThread

Open a thread.

Example
actions:
  - id: openThread

pinMessage

Pin a message.

Example
actions:
  - id: pinMessage

randomAction

Run a random action from a list of actions. The actions can be defined in the actions array. If the actions array is empty, the action will do nothing.

Prop

Type

Example
actions:
  - id: randomAction
    args:
      actions:
        - id: sendMessage
          args:
            content: "Hello there !"
        - id: addReaction
          args:
            value: "✅"

removeCoins

Remove coins from a user.

Prop

Type

Example
actions:
  - id: removeCoins
    args:
      amount: 50 # Amount of coins to remove

removeInviteBonus

Remove bonus invites to a user. Requires the Invite Traker addon.

Prop

Type

Example
actions:
  - id: removeInviteBonus
    args:
      amount: 5 # Amount of bonus invites

removeReaction

Remove a reaction from a message.

Prop

Type

Example
actions:
  - id: removeReaction
    args:
      value: "✅" # Remove a specific reaction

removeRole

Remove a role from a member.

Prop

Type

Example
actions:
  - id: removeRole
    args:
      value: "Admin" # Role ID or name
  - id: removeRole
    args:
      value:
        - "Admin" # Role ID or name
        - "Moderator" # Role ID or name

removeTag

Remove a tag from a thread.

Prop

Type

Example
actions:
  - id: removeTag
    args:
      value: "Tag1" # Tag ID
  - id: removeTag
    args:
      value:
        - "Tag1" # Tag ID
        - "Tag2" # Tag ID

reply

Reply to a message or an interaction. You can see the message configuration for more information. Can triggers follow-up actions

Prop

Type

Example
actions:
  - id: reply
    args:
      content: "Hello there !"
  - id: reply
    args:
      components:
        - type: text-display
          content: "This is a reply"

resetCooldown

Reset a cooldown for a user.

Prop

Type

Example
actions:
  - id: resetCooldown
    args:
      value: "daily_reward" # Cooldown name

sendMessage

Send a message. You can see the message configuration for more information.

Prop

Type

Example
actions:
  - id: sendMessage
    args:
      content: "Hello there !"
  - id: sendMessage
    args:
      components:
        - type: text-display
          content: "This is a message"

showModal

Display a modal to the current user. You can see the modal configuration for more information.

This action only works when the current context contains an interaction that can open a modal, such as a slash command, a button click, or a select menu submit.

Prop

Type

Example
actions:
  - id: showModal
    args:
      title: "Feedback"
      custom-id: "script_feedback_modal:premium"
      components:
        - type: label
          label: "Your message"
          component:
            type: text-input
            custom-id: "message"
            style: "Paragraph"
            required: true

sendPreset

Send a preset message. Requires the Presets addon.

Prop

Type

Example
actions:
  - id: sendPreset
    args:
      preset: "welcome_message" # Preset ID or name

sendPrivateMessage

Send a private message to a user. You can see the message configuration for more information. If the user has private messages disabled, the message will not be sent.

Prop

Type

Example
actions:
  - id: sendPrivateMessage
    args:
      content: "Hello there !"
  - id: sendPrivateMessage
    args:
      components:
        - type: text-display
          content: "This is a private message"

sendRequest

Send a http request. New variables will be added when you trigger an action after this action. With the format [[data_<object>]]. If you want a value that is inside an object, you can add the path with underscore _. For example, if you want the value of user.id, you can use %data_user_id%. *Can triggers follow-up actions

Prop

Type

Example
- id: sendRequest
  args:
    value: 'https://api.mcstatus.io/v2/status/java/mc.hypixel.net:25565' # URL
    follow-up-actions:
      - id: sendMessage
        args:
          content: "Players [[data_players_online]]/[[data_players_max]] | Version [[data_version_name_clean]]"

setCoins

Set the amount of coins for a user.

Prop

Type

Example
actions:
  - id: setCoins
    args:
      amount: 1000 # Amount of coins to set

setCooldown

Set a cooldown for a user.

Prop

Type

Example
actions:
  - id: setCooldown
    args:
      value: "daily_reward" # Cooldown name
      duration: 86400 # Duration in seconds (1 day)

setInviteBonus

Set bonus invites to a user. Requires the Invite Tracker addon.

Prop

Type

Example
actions:
  - id: setInviteBonus
    args:
      amount: 5 # Amount of bonus invites

setTag

Set tags to a thread.

Prop

Type

Example
actions:
  - id: setTag
    args:
      value: "Tag1" # Tag ID
  - id: setTag
    args:
      value:
        - "Tag1" # Tag ID
        - "Tag2" # Tag ID

startThread

Start a thread from a message.

Can triggers follow-up actions

Prop

Type

Example
actions:
  - id: startThread
    args:
      value: "Hello there !" # Thread name
  - id: startThread
    args:
      value:
        - "Thread 1" # Thread name
        - "Thread 2" # Thread name
      duration: 3600 # Thread auto archive duration in seconds (1 hour)

timeoutMember

Timeout a member for a certain duration. The duration is in seconds.

Prop

Type

Example
actions:
  - id: timeoutMember
    args:
      duration: 3600 # Duration in seconds (1 hour)

unlockThread

Unlock a thread. This will allow users to send messages in the thread.

Example
actions:
  - id: unlockThread

unpinMessage

Unpin a message.

Example
actions:
  - id: unpinMessage

On this page