Help Center/ Huawei Cloud Flexus_Huawei Cloud Flexus L Instance/ Best Practices/ Deploying OpenClaw/ Building a Personal AI Assistant with OpenClaw (Discord)
Updated on 2026-05-29 GMT+08:00

Building a Personal AI Assistant with OpenClaw (Discord)

Scenarios

With the advancement of AI technologies, personal AI assistants have become essential tools for improving work efficiency and quality of life. In daily online communication, people often need to interact with various AI assistants to obtain information or complete tasks. However, these AI assistants are usually limited to specific platforms or models, and have certain usage restrictions. As a result, users have to frequently switch between different platforms. This increases operation complexity.

OpenClaw (formerly known as Moltbot and clawdbot) is a continuously running AI agent that can invoke multiple large language models. Acting as a gateway, OpenClaw lets you interact with multiple AI models through messaging channels. This eliminates the need to switch between different platforms and streamlines the operation process.

This section describes how to deploy the OpenClaw application image on a FlexusL instance and integrate it with Discord to quickly build a personal AI assistant.

The OpenClaw application image provided by FlexusL is installed using official open-source scripts. Before deploying the image, read and acknowledge the risks described in OpenClaw Risk Notice and Security Suggestions.

The following steps describe how to purchase a FlexusL instance and configure a messaging channel from scratch. If some of the steps have been completed, you can skip them.

Step 1: Deploy a FlexusL Instance with the OpenClaw Application Image

You can deploy the OpenClaw application image on a new or an existing FlexusL instance.

  1. Go to the FlexusL instance purchase page.
  2. Specify required parameters for the FlexusL instance.

    Parameter

    Example

    Description

    Region

    CN-Hong Kong

    For low network latency and quick resource access, select the region nearest to your target users. After a FlexusL instance is created, the region cannot be changed. Exercise caution when selecting a region.

    Application Images

    OpenClaw

    Select the OpenClaw application image.

    Instance Specifications

    2 vCPUs | 4 GiB of memory and 80 GiB system disk

    It is recommended that you select 2 vCPUs | 4 GiB of memory or higher for the OpenClaw application image. Select appropriate instance specifications based on your service requirements.

    Instance Name

    OpenClaw-Example

    Enter a custom instance name that is easy to identify, for example, OpenClaw-Example.

    Associated Services (Optional)

    • Data Disk: 10 GiB
    • Host Security
    • Cloud Backup Vault: 70 GB

    You can associate EVS data disks, HSS (basic edition), and cloud backup vaults with your FlexusL instances as needed and set specifications as needed.

    Required Duration

    1 month

    Set the duration of your subscription in the range of 1 month to 3 years.

    Auto-renew is enabled by default, which means the purchased FlexusL instances will be automatically renewed before they expire. If you do not enable auto-renew during the purchase process, you can still enable it later after the instances are created. For more information about auto-renewal rules, see Auto-Renewal Rules.

    Quantity

    1

    Set the number of FlexusL instances to be purchased.

  3. Click Next: Confirm.

    On the displayed page, confirm the order details, read and select the agreement, and click Submit.

  4. Select a payment method and complete the payment.
  5. Go back to the FlexusL console and view the purchased FlexusL instance.
  1. Log in to the FlexusL console and check whether the target FlexusL instance is running the OpenClaw application image.

  2. Choose > Change OS on the target resource card. Select the OpenClaw application image and complete the OS change as instructed. After the change is complete and the FlexusL instance status is running, go to the next step.

    Changing the OS clears the data in all partitions of the system disk, including the system partition. Back up data in advance.

Step 2: Create a Discord Bot

  1. Sign in to the Discord development portal and click New Application.

  2. Enter the custom bot name, read and agree to the terms, and click Create.

  3. On the Applications page, choose Bot from the left navigation pane and click Reset Token to generate a new token.

    If authentication is required, enter the password of your Discord account.

    Copy and keep the token secure for subsequent OpenClaw configuration.

  4. On the bot configuration page, scroll down to Privileged Gateway Intents and enable the following intents as needed:
    • Message Content Intent: Mandatory. This is required for your bot to read messages. If disabled, the bot cannot read or reply to messages.
    • Server Members Intent: Recommended.
    • Presence Intent: Recommended.

    Enable the required intents and click Save Changes.

  5. In the left navigation pane, choose OAuth2. In the OAuth2 URL Generator module, configure the permissions under Scopes. You are advised to select bot and applications.commands based on the principle of least privilege (PoLP).

  6. Configure the permissions under Bot Permissions. Select View Channels, Send Messages, Embed Links, Attach Files, Read Message History, and Add Reactions (optional).

  7. Copy the generated URL at the bottom of the page and open it in a browser.

  8. In the displayed dialog box, select the Discord server to be added. This requires you to have the administrator permissions of the server.

  9. (Optional) If you have not created a server, you can create one on the Discord home page.

  10. After selecting a server, click Continue to perform authorization.

  11. Check that the server is added successfully. Information shown in the following figure is displayed.

Step 3: Configure the OpenClaw Application

  1. Log in to the FlexusL console.
  2. Click Configure Now on the target FlexusL instance card.

    If Configure Now is not displayed, click the resource card to go to the resource details page and choose Application Management from the left navigation pane.

    Some functions of the OpenClaw application image (such as querying gateway status and updating models and application configurations) depend on Cloud Operations Center (COC). You need to enable and authorize COC before using these functions. If the content in the following figure is displayed, enable and authorize COC as prompted.

  3. In the Application Management card, view the application details and manage the application as needed.

    If the page has not been refreshed for a long time or you need to check whether the gateway status has been changed, click to view the latest version and status.

    Table 1 Application details

    Application details

    Example

    Description

    Version

    2026.3.24

    OpenClaw version.

    Status

    Running

    OpenClaw gateway status.

    • Running: The OpenClaw service is working normally.
    • Unknown/Unhealthy: The initial status of the OpenClaw gateway is Loading. If the status changes to Unknown or Unhealthy after several minutes, click Restart. The restart takes some time. After the gateway is restarted successfully, the status changes to Running.
    NOTE:

    If the gateway status is still Unknown or Unhealthy after you click Restart, submit a service ticket.

    For details about application management, see OpenClaw application details and management operations.

  4. In the model configuration area, configure models and channels and install skills as needed.

(Optional) Step 4: Configure Security Groups

When you create a FlexusL instance, the system automatically creates a default security group (sg-default-smb) and associates it with the instance. The default security group only allows instances in the security group to communicate with each other but denies all external requests by default. In this example, use the default security group and default security group rules. You can perform the following operations to view and configure the security group rules.

  1. Log in to the FlexusL console and click the target resource card or instance name to go to the instance details page.
  2. In the navigation pane on the left, choose Cloud Servers and click the target server name to view its details.

  3. Click the Security Groups tab and check that the default security group rules are used.

    You can also add more rules as needed. For details, see Configuring Security Group Rules for a FlexusL Instance.

    If the source of an inbound rule is set to 0.0.0.0/0 or ::/0, then all external IP addresses are either allowed or denied to access your instances, depending on if the action is Allow or Deny. If the access is allowed, exposing high-risk ports, such as port 22, 3389, or 8848, to the public network will leave your instances vulnerable to network intrusions, service interruptions, data leaks, or ransomware attacks. You should only configure trusted IP addresses for the source in security group rules.

    Table 3 Security group rules

    Priority

    Action

    Type

    Protocol & Port

    Source

    Description

    1

    Allow

    IPv4

    TCP: All

    sg-default-smb

    Allows instances in the security group to communicate with each other over IPv4 protocols.

    1

    Allow

    IPv6

    TCP: All

    sg-default-smb

    Allows instances in the security group to communicate with each other over IPv6 protocols.

Step 5: Verify the Bot Conversation

  1. Return to the Discord platform. In the contact list of the Discord server, click the bot added in step 2.

    Type your message in the direct message chat box to start a conversation.

  2. Check that the bot can have a conversation with you.

(Optional) Step 6: Reset the Password and Log In to the FlexusL Instance

A FlexusL instance does not have an initial password. After creating a FlexusL instance, you need to set a password before logging in to it. For details, see Resetting the Password for a FlexusL Instance.

  1. Locate the resource card and choose > Reset Password. Alternatively, in the list view, click Reset Password in the Operation column to reset the password for the FlexusL instance.
    Figure 1 Resetting a password
  2. Locate the resource card and click Remote Login. Alternatively, in the list view, click Remote Login in the Operation column. In the displayed dialog box, click VNC Login and enter the username and password as prompted to log in to the FlexusL instance. For more login methods, see Login Modes.

    The username is root, and the password is the one you set in the previous step.

Helpful Links