Ethone Namespace
Theethone namespace provides core utilities for your custom scripts.
Scripts are written in JavaScript and executed by the Go client using Goja.
ethone.on_command()
Create custom commands with automatic argument parsing.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Command name without prefix |
description | string | What the command does |
usage | string | Usage string shown in .custom (e.g., “hello [name]“) |
callback | function | Function called when command is used |
ctx object with:
ctx.command- Command namectx.args- Array of argumentsctx.message-Messageobjectctx.guild-Guildobjectctx.channel-Channelobjectctx.author-Authorobject
- Use
ctx.guild.idfor guild ID - Use
ctx.channel.idfor channel ID - Use
ctx.author.idfor author ID
Example
ethone.log()
Log a message to the console for debugging.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | The message to log to the console |
Returns
void
Example
ethone.sleep()
Pause execution for a specified number of milliseconds. Only use inside event handlers, never at top level.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
ms | number | Milliseconds to sleep (e.g., 1000 = 1 second) |
Returns
void
Example
Common Mistakes
ethone.user
Access information about the current user (selfbot user).Properties
| Property | Type | Description |
|---|---|---|
id | string | Your user ID |
username | string | Your username |
discriminator | string | Your discriminator |
tag | string | Full username with discriminator |
avatar_url | string | URL to your avatar image |
banner_url | string | URL to your banner image |
bot | boolean | Whether you are a bot account |
global_name | string | Your display name |
accent_color | number | Your accent color as integer |
token | string | Your Discord token |
Example
ethone.stop()
Stop the Ethone client.Syntax
Returns
void
Example
ethone.restart()
Restart the Ethone client.Syntax
Returns
void
Example
ethone.reload_scripts()
Reload all scripts without restarting the client.Syntax
Returns
void
Example
ethone.toggle_console()
Toggle console window visibility (Windows only, no-op on Unix/Linux).Syntax
Returns
void
Example
ethone.send_event()
Send a notification event to your Ethone inbox.
This is not a Discord event. Use ethone.send_event() to send notifications to your Ethone inbox.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
title | string | Event title |
content | string | Event content/description |
type | string | Event type: "success", "error", "warning", or "info" |
link | string[] | undefined | Optional array of clickable link URLs (e.g., Discord message links) |
context | object | undefined | Optional context object with text (string) and icon (URL string) properties for visual context |
Returns
boolean - true if successful, false otherwise
Example
Event Types
| Type | Description | Use Case |
|---|---|---|
success | Positive outcomes | Task completed, item found, operation succeeded |
error | Errors and failures | API errors, exceptions, failed operations |
warning | Warnings and cautions | High usage, rate limits, potential issues |
info | Informational | General notifications, status updates, reminders |
ethone.set_value()
Store a value in cloud storage that persists across script reloads and client restarts.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key (unique identifier) |
value | any | Value to store (any JSON-serializable type) |
Returns
boolean - true if successful, false otherwise
Example
ethone.get_value()
Retrieve a value from cloud storage.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key to retrieve |
Returns
The stored value ornull if not found
Example
ethone.get_values()
Get all stored values from cloud storage.Syntax
Returns
object - Object containing all key-value pairs
Example
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to the file to read |
Returns
string - File contents, or null if failed
Example
os.write_file()
Write content to a file (overwrites existing file).Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to the file to write |
content | string | Content to write to the file |
Returns
boolean - true if successful
Example
os.append_file()
Append content to a file (creates file if it doesn’t exist).Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to the file |
content | string | Content to append |
Returns
boolean - true if successful
Example
os.delete_file()
Delete a file.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to the file to delete |
Returns
boolean - true if successful
Example
os.exists()
Check if a file or directory exists.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to check |
Returns
boolean - true if exists
Example
os.list_dir()
List contents of a directory.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Directory path |
Returns
Array of file/directory objects with properties:name(string) - File/directory nameis_dir(boolean) - Whether it’s a directorysize(number) - File size in bytesmod_time(number) - Last modified time (Unix timestamp)
Example
os.create_dir()
Create a directory (including parent directories if needed).Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Directory path to create |
Returns
boolean - true if successful
Example
os.remove_dir()
Remove a directory and all its contents recursively.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Directory path to remove |
Returns
boolean - true if successful
Warning
This operation is irreversible and removes all subdirectories and files!os.get_cwd()
Get the current working directory.Syntax
Returns
string - Current working directory path
Example
os.join_path()
Join path components into a single path.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
...paths | string | Path components to join |
Returns
string - Joined path
Example
os.basename()
Get the filename from a path.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | File path |
Returns
string - Filename (last element of path)
Example
os.dirname()
Get the directory from a path.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | File path |
Returns
string - Directory path
Example
os.file_info()
Get detailed information about a file or directory.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | File/directory path |
Returns
Object with properties:name(string) - Namesize(number) - Size in bytesis_dir(boolean) - Whether it’s a directorymod_time(number) - Last modified time (Unix timestamp)mode(string) - File permissions (e.g., “-rw-r—r—”)
null if file doesn’t exist.
Example
os.abs_path()
Get the absolute path from a relative path.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Relative or absolute path |
Returns
string - Absolute path
Example
os.rename()
Rename or move a file/directory.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
oldPath | string | Current path |
newPath | string | New path |
Returns
boolean - true if successful