Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ethone.cc/llms.txt

Use this file to discover all available pages before exploring further.

How It Works

Scripts are written in JavaScript and get converted to Go code dynamically when loaded into the Ethone client.

Quick Start

ethone.on_command(
    "greet",              // name
    "Greet someone",      // description
    "greet <name>",       // usage
    function(ctx) {       // callback
        if (ctx.args.length === 0) {
            discord.send_message(ctx.channel.id, "Usage: .greet <name>");
            return;
        }
        var name = ctx.args.join(" ");
        var message = "Hello, " + name + "!";
        discord.send_message(ctx.channel.id, message);
    }
);

discord.on_message = function(ctx) {
    var content = ctx.content;
    var author = ctx.author.username;
    var logMessage = "Received: " + content + " from " + author;
    ethone.log(logMessage);
};

Recommendations

Don’t use blocking code at the top level:
// Bad - Will timeout
while (true) {
    ethone.log("This will freeze!");
}

// Bad - Will timeout
ethone.sleep(5000); // at top level

// Good - Inside event handler
discord.on_message = function(ctx) {
    ethone.sleep(1000); // Ok here!
    discord.send_message(ctx.channel.id, "Delayed response");
};

API Reference

  • Ethone Namespace - Core utilities (logging, sleep, events, storage)
  • OS Namespace - File system operations (read, write, directories, file info)
  • Discord Namespace - Discord API (messages, channels, roles, members)
  • Event Hooks - Discord events (messages, members, channels, roles)
  • Commands - Command system with auto-parsing