Hello World

Example

In this simple example, the bot will send a message every time a new conversation is started. You can restart your conversation by selecting “Wipe” from “…” in a conversation.

Steps:

  1. Create bot

    1. Open https://ugly.bot

    2. Click on bots

    3. Click on “+” in top-right

    4. Change template to “Custom Python Code”

    5. Click on “Create Bot”

  2. Update main.py

    1. Click on “Code” tab

    2. Replace the contents of main.py with the text from below

    3. It will auto-save your changes immediately

  3. Open chat

    1. Click on “Settings” tab

    2. Click on “Chat” button in the bottom bar

    3. The event “conversation_start” happens when some starts a new conversation with this bot, if you want to restart your conversation click on “…” in the top-right and select “Wipe”

Walkthrough

main.py

from ugly_bot import *

@export("conversation_start")
def hello_world():
    message_send(text="Hello World")

start()