Skip to main content
This guide is a complete, step-by-step tutorial on building modern Discord applications. Whether youโ€™re making a simple ping bot or a complex economy system with context menus and modals, everything is covered here.

๐Ÿ Phase 1: The Foundation

Every bot starts with a token and initialization. We recommend using the env module to keep your token secret.
import discord
import env

# 1. Setup your credentials
token = env.get("DISCORD_TOKEN")
bot = discord.bot(token)

# 2. Start the engine
bot.run()

โšก Phase 2: Slash Commands

Slash commands are the primary way users interact with your bot. In Helix, you register them with a name and a description.

Basic Command

bot.command("ping", "Check if the bot is alive")
    interaction.respond("๐Ÿ“ Pong! Latency is {bot.latency}ms")

Commands with Parameters

Users can provide input to your commands. Helix automatically maps these to the interaction object.
bot.command("echo", "Make the bot say something")
    text = interaction.params.text
    interaction.respond("You said: " + text)

bot.command("add", "Add two numbers")
    n1 = interaction.params.n1
    n2 = interaction.params.n2
    result = n1 + n2
    interaction.respond("The sum is: {result}")

๐Ÿ–ฑ๏ธ Phase 3: User Apps (Context Menus)

This is a premium feature. User Apps appear when you right-click a User or a Message. They donโ€™t require typingโ€”just a right-click.

User Context Menu

Great for profile lookups or moderation.
bot.user_command("View Details")
    target = interaction.target_user
    interaction.respond("Targeting: {target.name} (ID: {target.id})")

Message Context Menu

Perfect for quoting, reporting, or translating messages.
bot.message_command("Quote as Embed")
    msg = interaction.target_message
    interaction.embed
        author msg.author.name
        description msg.content
        footer "Sent in <#{msg.channel_id}>"

๐Ÿ”˜ Phase 4: Interactivity (Buttons & Selects)

Static text is boring. Add buttons and dropdowns to your responses to make them feel like a real app.

Adding Buttons

Simply add an indented block to your respond or ephemeral call.
bot.command("verify", "Show verification")
    interaction.respond("Click the green button to gain access:")
        interaction.button("Verify Me", "btn_verify", "success")
        interaction.button("Help", "btn_help", "secondary")

Select Menus (Dropdowns)

Allow users to pick from a list of options.
bot.command("color", "Pick a role color")
    interaction.respond("Select your favorite color:")
        interaction.select("menu_color")
            interaction.option("Red", "clr_red")
            interaction.option("Blue", "clr_blue")
            interaction.option("Green", "clr_green")

๏ฟฝ Phase 5: Modals (Forms)

Need more than one input? Pop up a full form (Modal).
bot.command("report", "Report a bug")
    interaction.modal("bug_report", "New Bug Report")
        interaction.input("Summary", "inp_summary", "Short")
        interaction.input("Steps to Reproduce", "inp_steps", "Paragraph")

๐Ÿ–ผ๏ธ Phase 6: Rich Media (Embeds)

Embeds allow you to send organized, colored boxes with images and fields.
bot.command("stats", "Show server stats")
    interaction.embed
        title "Server Overview: {guild.name}"
        description "Detailed analytics for our community."
        color "#5865F2" # Discord Blurple
        thumbnail guild.icon_url
        field "Members" guild.member_count true
        field "Boosts" guild.boost_count true
        image "https://example.com/banner.png"
        footer "Requested by {user.name}"

๐Ÿ›ก๏ธ Phase 7: Server Management & Moderation

Helix simplifies complex moderation tasks into one-line commands.
bot.command("kick", "Kick a user")
    target = interaction.target_user
    reason = interaction.params.reason
    
    bot.kick(target, reason)
    interaction.ephemeral("โœ… Successfully kicked {target.name}")

bot.command("timeout", "Mute a user")
    target = interaction.target_user
    bot.timeout(target, "1h") # 1 hour timeout
    interaction.respond("{target.name} has been timed out for 1 hour.")

๏ฟฝ Phase 8: Global Events

Listen to everything happening on your server using the .on() gateway listener.
# Welcome new members
bot.on("member_join")
    channel = bot.get_channel("123456789")
    channel.send("Welcome to the server, {user.mention}!")

# Auto-logger
bot.on("message_delete")
    print("A message was deleted in <#{message.channel_id}>")

๐Ÿ—๏ธ Phase 9: Putting it all Together

Here is a complete, production-ready bot template combining multiple features:
import discord
import env
import date

bot = discord.bot(env.get("DISCORD_TOKEN"))
bot.intents(["guilds", "members", "messages", "message_content"])

# --- Commands ---
bot.command("help", "Get bot help")
    interaction.embed
        title "Help Menu"
        description "I can do serveral things!"
        field "Economy" "`/bal`, `/work`"
        field "Mod" "`/kick`, `/ban`"
        color "blue"

# --- User Apps ---
bot.user_command("Profile")
    target = interaction.target_user
    interaction.respond("Profile for {target.name}:")
        interaction.button("Poke", "btn_poke_" + target.id, "primary")

# --- Events ---
bot.on("ready")
    print("--- [HELIX BOT ONLINE] ---")
    print("Name: {bot.name}")
    print("Time: {date.now()}")

bot.run()

๐Ÿ“š Quick Reference Table

FeatureHelix MethodScope
Slashbot.command(name, desc)Global Command
User Appbot.user_command(label)Right-click User
Msg Appbot.message_command(label)Right-click Message
Eventbot.on(event_name)Gateway Events
Embedinteraction.embedResponse Block
Buttonsinteraction.button(label, id, style)Response/Embed Block
Selectinteraction.select(id)Response/Embed Block
Formsinteraction.modal(id, title)Popup Window

โ† Back to Modules Overview