For the complete documentation index, see llms.txt. This page is also available as Markdown.

Images

upload.lua

Upload Configuration Explanation

The Upload configuration allows you to set up image uploading for your MDT system. You can choose between different upload methods: Discord, Imgur, FiveManage, or a custom solution.

Main Configuration

Upload = {}
Upload.Method = 'fivemanage'  -- Options: 'discord', 'imgur', 'fivemanage', 'custom'

Upload.Method specifies which upload service to use. Set this to one of the available options.

Upload Methods Configuration

Each upload method has its own configuration:

Upload.Methods = {
    ['discord'] = { ... },
    ['imgur'] = { ... },
    ['fivemanage'] = { ... },
    ['custom'] = { ... }
}

Discord Upload

['discord'] = {
    link = 'https://discord.com/api/webhooks/',  -- Your webhook link
    field = 'files[]',
    path = 'attachments.1.url',
    options = {
        encoding = 'webp'  -- Options: 'webp', 'png', 'jpg'
    }
}

To set up Discord uploading:

  1. Create a webhook in your Discord server.

  2. Replace 'https://discord.com/api/webhooks/' with your full webhook URL.

  3. Choose an encoding format ('webp' for smaller file sizes, or 'png'/'jpg' for different formats).

Example:

Imgur Upload

To set up Imgur uploading:

  1. Create an Imgur account and register an application to get a Client ID.

  2. Replace 'YOUR_KEY_HERE' with your Imgur Client ID.

Example:

FiveManage Upload

To set up FiveManage uploading:

  1. Obtain an API key from FiveManage.

  2. Replace 'YOUR_KEY_HERE' with your FiveManage API key.

  3. Optionally, change the encoding if needed.

Example:

Custom Upload

To set up a custom upload solution:

  1. Replace 'https://api.your_website.com/api' with your custom API endpoint.

  2. Adjust the field and path values to match your API's requirements.

  3. Add any necessary headers, including authorization if required.

Example:

Remember to choose your preferred upload method by setting Upload.Method to the corresponding key ('discord', 'imgur', 'fivemanage', or 'custom') and properly configure that method's settings.

Last updated