Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Latest commit

 

History

History
132 lines (98 loc) · 7.94 KB

custom-commands.md

File metadata and controls

132 lines (98 loc) · 7.94 KB

Custom Commands

Overview

This feature allows you to set up custom commands that Cakey Bot can handle. For example, you can make your own command called !support which will post a message informing your users where they can get support for your server.

Setup

{% hint style="warning" %} You will need Manage Server or Administrator permission to manage servers and custom commands. {% endhint %}

  1. Login to the web dashboard on the main website here.
  2. Click on the server you want to edit custom commands on.
  3. Go to the "Custom Commands" page.
  4. You can then create, delete and edit any commands on this page. You can get an overview of any triggers that are available below. You can also use our custom placeholders in your commands as well!

{% hint style="info" %} The command trigger will use a custom set prefix if you have changed Cakey Bot's prefix. {% endhint %}

Limitations/Restrictions

  • You can't have duplicate triggers with the same name
  • Custom Commands are also limited to Discord's message character limit
  • Messages sent by bots or webhooks will be ignored

Placeholders/Variables

Custom Commands will work with BOTH Basic Placeholders & Advanced Placeholders. Placeholders can be included in the response section and can modify the behavior/output of the response. You can find the full list of supported placeholders here.

Using Emoji/Emotes in Responses

Emoji/Emotes CAN be used in Custom Commands. However, it requires slightly more work due to how discord parses emotes. Normally in Discord, you could just type :lel: or :smile: to get an emote, however in Cakey Bot, neither of these will work. In order to get valid emojis you have to send the emojis in discord but place a backward slash in front of it to get the emote's full ID. Like so: \:lel: or \:smile: which will produce these results: <:lel:408424717217693717> or for Unicode emoji: 😄 . Once you have the full emoji id or the raw Unicode output, you can paste these into Cakey Bot's web dashboard and they should work as long as Cakey Bot is in a server that has that custom emote in it.

{% hint style="info" %} It is worth noting that Cakey Bot can use emojis in between servers (similar to nitro users). So if you have an emoji in Server #1, you can use that emoji in a response for Server #2 if Cakey bot is in both of those servers. {% endhint %}

Using Images in Responses

To use images in responses, you can simply just type the image URL/link like you would in a normal message. If you have the file on your local machine/PC but no URL/link, you can upload it to an image hosting website (such as Imgur) and paste the URL they provide into the response. Cakey Bot should automatically embed the image in Discord's client if it's a valid URL/image.

Custom Embeds

{% hint style="warning" %} Using custom embeds on responses is a Premium Only feature. {% endhint %}

You can include an optional embed on responses by following the steps below:

  1. Follow the instructions at the top of this page to sign in to the dashboard.
  2. Use our custom embed editor to design your embed.
  3. Copy your browser URL or click the "Get Data Link" button in the dropdown menu and copy the URL from there.
  4. Create an auto responder like you normally would and paste the URL you copied in the last step into the Embed URL text field.

Bulk Import/Export

{% hint style="info" %} You must apply via support tickets to get access to Bulk Import. Anyone can use Bulk Export without applying. This is to decrease potential abuse. {% endhint %}

Limitations/Guidelines

  • File MUST be in CSV format.
  • File MUST be formatted with all of the required columns.
  • Additional/extra columns will be ignored.
  • Command & Response fields MUST be Base64 encoded.
  • Any fields that have too many characters will be trimmed. Column limits:
    • Command: 200 characters (before base64 encoding)
    • Response: 2,000 characters (before base64 encoding)
  • Any fields that are not Base64 encoded or exceed the character will NOT work after importing.
  • Bulk importing can NOT be canceled or reversed once started.
  • Any broken commands will have to be individually deleted or fixed after the import is finished.
  • There is a limit of 500 commands per bulk import.

What is Base64 encoding?

Base64 is a group of binary-to-text encoding schemes that represent binary data in sequences of 24 bits that can be represented by four 6-bit Base64 digits. This sounds complicated, however, it's EXTREMELY easy to convert text to and from Base64 encoding. There are tons of online tools just like this one that automates the entire process just by you pasting your text in it.

How can I Base64 encode a string?

If you are using the tool linked above, all you have to do is paste your text in the top text input and it'll convert it into Base64 encoding and display it in the second text box. You can also convert Base64 back into text by using this tool OR by selecting "Decoding" at the top of the page and using the same process.

{% hint style="info" %} Note: The convert file process on this page converts the ENTIRE raw file itself and not just the contents of the file. This means you can NOT use the convert file process when converting for Cakey Bot. {% endhint %}

How can I convert a ton of lines/rows of data?

This is easy as well! Using the same Base64 encoding tool linked above you can simply paste all of your data (each row on a new line) and simply check the "Encode each line separately (useful for when you have multiple entries)." option. This will then convert each line individually rather than treating every single line as a single blob of text.

{% hint style="warning" %} Note: If you are doing this for a ton of data, you can only process/paste one column of data at a time. If you try to copy multiple columns in the spreadsheet and paste all of them at once it'll merge the rows together as a single string. {% endhint %}

What do the columns/fields and their values mean?

The template CSV file and bulk exported CSVs will have a few different columns with various restrictions. These are explained below:

  • Status
    • This determines whether or not the command/response is "enabled" or "disabled"
    • Acceptable values:
      • 0 - Disabled
      • 1 - Enabled
  • Command
    • This is the command/trigger phrase for a response.
    • It must be Base64 encoded and be less than 200 characters before Base64 encoding.
  • Triggers
    • This is an internal value that determines whether or not a command is an Auto Responder or a Custom Command. The import script will ignore any value you put here and force set it internally.
    • Acceptable values:
      • 1 - Custom Commands
      • 2 - Auto Responders
  • Flags
    • These are only used for Auto Responders, they map directly to the Auto Responder flags.
    • Acceptable values:
      • 1 - Exact Match
      • 2 - Contains
      • 3 - Starts With
      • 4 - Ends With
      • 5 - Contains Files
      • 6 - From Webhook
      • 7 - Contains user mention
      • 8 - Contains channel mention
      • 9 - Contains role mention
      • 10 - Wildcard Contains
  • Response
    • This is the response phrase for a trigger/command.
    • It must be Base64 encoded and be less than 2,000 characters before Base64 encoding.
  • Embed