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.
Discord Events
All Discord events are available through the discord namespace. Set a function to an event property to handle that event in real-time.
Message Events
discord.on_message
Fired when any message is received in Discord.
Event Context
The event receives a ctx object:
| Property | Type | Description |
|---|
ctx.message | Message | Full message object (id, content, timestamp, etc.) |
ctx.guild | Guild | Full guild object (name, member_count, icon, etc.) |
ctx.channel | Channel | Full channel object (name, type, topic, etc.) |
ctx.author | Author | Full author object (username, id, avatar, etc.) |
ctx.content | string | Message content (shortcut for ctx.message.content) |
ctx.mentions | Author[] | Mentioned users |
ctx.attachments | Attachment[] | Message attachments |
ctx.embeds | Embed[] | Message embeds |
Example
discord.on_message = function(ctx) {
if (ctx.author.bot) return;
ethone.log("Message from " + ctx.author.username + " in #" + ctx.channel.name);
if (!ctx.guild) {
discord.send_message(ctx.channel.id, "Thanks for the DM!");
}
if (ctx.guild && ctx.guild.name === "My Server") {
if (ctx.content.toLowerCase().includes("hello")) {
discord.send_message(ctx.channel.id, "Hello in " + ctx.guild.name + "!");
}
}
};
discord.on_message_update
Fired when a message is edited.
Event Context
| Property | Type | Description |
|---|
ctx.after | Message | Full message object with new content |
ctx.before | Message | Full message object with old content (if cached) |
ctx.guild | Guild | Full guild object |
ctx.channel | Channel | Full channel object |
ctx.author | Author | Full author object |
Example
discord.on_message_update = function(ctx) {
ethone.log("Message edited by " + ctx.author.username);
ethone.log(" In: #" + ctx.channel.name + " (" + ctx.guild.name + ")");
if (ctx.before) {
ethone.log(" Old content: " + ctx.before.content);
}
ethone.log(" New content: " + ctx.after.content);
var logChannel = "YOUR_LOG_CHANNEL_ID";
discord.send_message(logChannel, ctx.author.username + " edited a message");
};
discord.on_message_delete
Fired when a message is deleted.
Event Context
| Property | Type | Description |
|---|
ctx.message | Message | Full message object (id, cached content if available) |
ctx.guild | Guild | Full guild object |
ctx.channel | Channel | Full channel object |
Example
var deletedMessages = [];
discord.on_message_delete = function(ctx) {
deletedMessages.push({
id: ctx.message.id,
channel: ctx.channel.name,
guild: ctx.guild.name,
timestamp: Date.now()
});
ethone.log("Message deleted in #" + ctx.channel.name);
};
discord.on_message_delete_bulk
Fired when multiple messages are deleted at once (e.g., bulk delete).
Event Context
| Property | Type | Description |
|---|
ctx.ids | string[] | Array of deleted message IDs |
ctx.channel_id | string | Channel ID where messages were deleted |
ctx.guild_id | string | Guild ID (if in a server) |
ctx.channel | Channel | Full channel object |
ctx.guild | Guild | Full guild object (if in a server) |
Example
discord.on_message_delete_bulk = function(ctx) {
ethone.log("Bulk delete in #" + ctx.channel.name);
ethone.log(" Deleted " + ctx.ids.length + " messages");
};
Reaction Events
discord.on_message_reaction_add
Fired when a reaction is added to a message.
Event Context
| Property | Type | Description |
|---|
ctx.user | Author | Full user object who added the reaction |
ctx.guild | Guild | Full guild object |
ctx.channel | Channel | Full channel object |
ctx.message | Message | Full message object that was reacted to |
ctx.emoji | Emoji | Emoji information (id, name, animated) |
Example
discord.on_message_reaction_add = function(ctx) {
ethone.log("Reaction " + ctx.emoji.name + " by " + ctx.user.username);
if (ctx.emoji.name === "👍") {
discord.send_message(ctx.channel.id, ctx.user.username + " liked this!");
}
};
discord.on_message_reaction_remove
Fired when a reaction is removed from a message.
Event Context
Same structure as on_message_reaction_add.
Example
discord.on_message_reaction_remove = function(ctx) {
ethone.log("Reaction removed: " + ctx.emoji.name + " by " + ctx.user.username);
};
discord.on_message_reaction_remove_all
Fired when all reactions are removed from a message.
Event Context
| Property | Type | Description |
|---|
ctx.message_id | string | Message ID |
ctx.channel_id | string | Channel ID |
ctx.guild_id | string | Guild ID (if in a server) |
ctx.channel | Channel | Full channel object |
ctx.guild | Guild | Full guild object (if in a server) |
Example
discord.on_message_reaction_remove_all = function(ctx) {
ethone.log("All reactions removed from message " + ctx.message_id);
};
discord.on_message_reaction_remove_emoji
Fired when all reactions of a specific emoji are removed from a message.
Event Context
| Property | Type | Description |
|---|
ctx.message_id | string | Message ID |
ctx.channel_id | string | Channel ID |
ctx.guild_id | string | Guild ID (if in a server) |
ctx.emoji | Object | Emoji that was removed |
ctx.emoji.name | string | Emoji name |
ctx.emoji.id | string | Emoji ID (custom emojis) |
ctx.channel | Channel | Full channel object |
ctx.guild | Guild | Full guild object (if in a server) |
Example
discord.on_message_reaction_remove_emoji = function(ctx) {
ethone.log("Removed all " + ctx.emoji.name + " reactions");
};
Poll Events
discord.on_message_poll_vote_add
Fired when a user votes in a poll.
Event Context
| Property | Type | Description |
|---|
ctx.user_id | string | User who voted |
ctx.channel_id | string | Channel ID |
ctx.message_id | string | Message ID containing the poll |
ctx.guild_id | string | Guild ID (if in a guild) |
ctx.answer_id | number | The answer ID that was voted for |
ctx.channel | Channel | Channel context |
ctx.guild | Guild | Guild context |
Example
discord.on_message_poll_vote_add = function(ctx) {
ethone.log("User voted on answer " + ctx.answer_id);
};
discord.on_message_poll_vote_remove
Fired when a user removes their vote from a poll.
Event Context
Same structure as on_message_poll_vote_add.
Example
discord.on_message_poll_vote_remove = function(ctx) {
ethone.log("User removed vote from answer " + ctx.answer_id);
};
Channel Events
discord.on_channel_create
Fired when a channel is created.
Event Context
| Property | Type | Description |
|---|
ctx.channel | Channel | Full channel object (id, name, type, topic, nsfw, etc.) |
ctx.guild | Guild | Full guild object |
Example
discord.on_channel_create = function(ctx) {
ethone.log("New channel: #" + ctx.channel.name);
ethone.log(" Type: " + ctx.channel.type);
ethone.log(" Guild: " + ctx.guild.name);
};
discord.on_channel_update
Fired when a channel is updated (name, topic, permissions, etc.).
Event Context
| Property | Type | Description |
|---|
ctx.after | Channel | Updated channel object |
ctx.before | Channel | Previous channel state (if cached) |
ctx.guild | Guild | Full guild object |
Example
discord.on_channel_update = function(ctx) {
if (ctx.before && ctx.before.name !== ctx.after.name) {
ethone.log("Channel renamed: #" + ctx.before.name + " -> #" + ctx.after.name);
} else {
ethone.log("Channel updated: #" + ctx.after.name);
}
if (ctx.after.topic) {
ethone.log(" Topic: " + ctx.after.topic);
}
};
discord.on_channel_delete
Fired when a channel is deleted.
Event Context
| Property | Type | Description |
|---|
ctx.channel | Channel | Full channel object (id, name, type) |
ctx.guild | Guild | Full guild object |
Example
discord.on_channel_delete = function(ctx) {
ethone.log("Channel deleted: #" + ctx.channel.name);
};
discord.on_channel_pins_update
Fired when a message is pinned or unpinned in a channel.
Event Context
| Property | Type | Description |
|---|
ctx.channel_id | string | Channel ID |
ctx.guild_id | string | Guild ID (if in a server) |
ctx.last_pin_timestamp | string | Timestamp of last pinned message |
ctx.channel | Channel | Full channel object |
ctx.guild | Guild | Full guild object (if in a server) |
Example
discord.on_channel_pins_update = function(ctx) {
ethone.log("Pins updated in #" + ctx.channel.name);
};
discord.on_channel_recipient_add
Fired when a user is added to a group DM.
Event Context
| Property | Type | Description |
|---|
ctx.channel_id | string | Group DM channel ID |
ctx.user | Author | User who was added |
ctx.nick | string | User’s nickname in the group DM |
ctx.channel | Channel | Full channel object |
Example
discord.on_channel_recipient_add = function(ctx) {
ethone.log(ctx.user.username + " was added to the group");
};
discord.on_channel_recipient_remove
Fired when a user is removed from a group DM.
Event Context
Same structure as on_channel_recipient_add.
Example
discord.on_channel_recipient_remove = function(ctx) {
ethone.log(ctx.user.username + " left the group");
};
Guild Events
discord.on_guild_create
Fired when YOU join a server or when a server becomes available.
Note: This is different from on_guild_member_add which fires when OTHER users join a server.
Event Context
| Property | Type | Description |
|---|
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_create = function(ctx) {
ethone.send_event("Joined Server", "You joined " + ctx.guild.name, "success");
};
discord.on_guild_update
Fired when a guild is updated (name, icon, settings, etc.).
Event Context
| Property | Type | Description |
|---|
ctx.after | Guild | Updated guild object |
ctx.before | Guild | Previous guild state (if cached) |
Example
discord.on_guild_update = function(ctx) {
if (ctx.before && ctx.before.name !== ctx.after.name) {
ethone.log("Guild renamed: " + ctx.before.name + " -> " + ctx.after.name);
} else {
ethone.log("Guild updated: " + ctx.after.name);
}
};
discord.on_guild_delete
Fired when YOU leave a server or when a server becomes unavailable.
Event Context
| Property | Type | Description |
|---|
ctx.guild_id | string | ID of the guild you left |
ctx.unavailable | boolean | True if the guild is unavailable (outage), false if you left |
Example
discord.on_guild_delete = function(ctx) {
if (!ctx.unavailable) {
ethone.send_event("Left Server", "You left server ID: " + ctx.guild_id, "warning");
}
};
discord.on_guild_emojis_update
Fired when a guild’s emojis are updated.
Event Context
| Property | Type | Description |
|---|
ctx.guild_id | string | Guild ID |
ctx.emojis | Emoji[] | Array of emoji objects |
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_emojis_update = function(ctx) {
ethone.log("Emojis updated in " + ctx.guild.name);
ethone.log(" Total emojis: " + ctx.emojis.length);
};
discord.on_guild_integrations_update
Fired when a guild’s integrations are updated.
Event Context
| Property | Type | Description |
|---|
ctx.guild_id | string | The guild ID |
ctx.guild | Guild | Guild context |
Example
discord.on_guild_integrations_update = function(ctx) {
ethone.log("Integrations updated in " + ctx.guild.name);
};
discord.on_guild_members_chunk
Fired when a chunk of guild members is received.
Event Context
| Property | Type | Description |
|---|
ctx.guild_id | string | The guild ID |
ctx.members | Member[] | Array of member objects |
ctx.chunk_index | number | Current chunk index |
ctx.chunk_count | number | Total number of chunks |
ctx.nonce | string | Request nonce |
ctx.guild | Guild | Guild context |
Example
discord.on_guild_members_chunk = function(ctx) {
ethone.log("Received " + ctx.members.length + " members (chunk " + ctx.chunk_index + "/" + ctx.chunk_count + ")");
};
Member Events
discord.on_guild_member_add
Fired when ANOTHER USER joins a server/guild.
Important: This event only fires when OTHER users join servers, not when YOU join a server. If you want to detect when you join a server, use discord.on_guild_create instead.
Event Context
| Property | Type | Description |
|---|
ctx.user | Author | Full user object |
ctx.guild | Guild | Full guild object |
ctx.joined_at | string | ISO timestamp of when they joined |
ctx.nick | string | Their server nickname (if set) |
ctx.roles | string[] | Array of role IDs assigned |
Example
discord.on_guild_member_add = function(ctx) {
ethone.log("New member: " + ctx.user.username);
ethone.log(" Guild: " + ctx.guild.name);
discord.send_message("WELCOME_CHANNEL_ID", "Welcome " + ctx.user.username + "!");
};
discord.on_guild_member_update
Fired when a member is updated (roles changed, nickname changed, etc.).
Event Context
| Property | Type | Description |
|---|
ctx.after | object | Updated member state with user, nick, roles, joined_at |
ctx.before | object | Previous member state (if cached) |
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_member_update = function(ctx) {
if (ctx.before && ctx.before.nick !== ctx.after.nick) {
var oldNick = ctx.before.nick || ctx.after.user.username;
var newNick = ctx.after.nick || ctx.after.user.username;
ethone.log("Nickname changed: " + oldNick + " -> " + newNick);
} else {
ethone.log("Member updated: " + ctx.after.user.username);
}
if (ctx.nick) {
ethone.log(" Nickname: " + ctx.nick);
}
};
discord.on_guild_member_remove
Fired when a member leaves or is kicked from a server.
Event Context
| Property | Type | Description |
|---|
ctx.user | Author | Full user object |
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_member_remove = function(ctx) {
ethone.log("Member left: " + ctx.user.username);
ethone.log(" From: " + ctx.guild.name);
};
Role Events
discord.on_guild_role_create
Fired when a role is created.
Event Context
| Property | Type | Description |
|---|
ctx.guild | Guild | Full guild object |
ctx.role | Role | Full role object (id, name, color, permissions, etc.) |
Example
discord.on_guild_role_create = function(ctx) {
ethone.log("Role created: " + ctx.role.name);
ethone.log(" In: " + ctx.guild.name);
};
discord.on_guild_role_update
Fired when a role is updated.
Event Context
| Property | Type | Description |
|---|
ctx.after | object | Updated role object |
ctx.before | object | Previous role state (if cached) |
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_role_update = function(ctx) {
if (ctx.before && ctx.before.name !== ctx.after.name) {
ethone.log("Role renamed: " + ctx.before.name + " -> " + ctx.after.name);
} else {
ethone.log("Role updated: " + ctx.after.name);
}
};
discord.on_guild_role_delete
Fired when a role is deleted.
Event Context
| Property | Type | Description |
|---|
ctx.guild | Guild | Full guild object |
ctx.role_id | string | The deleted role ID |
Example
discord.on_guild_role_delete = function(ctx) {
ethone.log("Role deleted: " + ctx.role_id);
};
Ban Events
discord.on_guild_ban_add
Fired when a user is banned from a guild.
Event Context
| Property | Type | Description |
|---|
ctx.user | Author | User who was banned |
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_ban_add = function(ctx) {
ethone.log("User banned: " + ctx.user.username);
ethone.log(" From: " + ctx.guild.name);
};
discord.on_guild_ban_remove
Fired when a user is unbanned from a guild.
Event Context
Same structure as on_guild_ban_add.
Example
discord.on_guild_ban_remove = function(ctx) {
ethone.log("User unbanned: " + ctx.user.username);
};
Thread Events
discord.on_thread_create
Fired when a thread is created.
Event Context
| Property | Type | Description |
|---|
ctx.thread | Channel | Thread channel object |
ctx.newly_created | boolean | Whether the thread was just created |
ctx.guild | Guild | Full guild object |
Example
discord.on_thread_create = function(ctx) {
ethone.log("Thread created: " + ctx.thread.name);
};
discord.on_thread_update
Fired when a thread is updated.
Event Context
| Property | Type | Description |
|---|
ctx.after | object | Updated thread object |
ctx.before | object | Previous thread state (if cached) |
ctx.guild | Guild | Full guild object |
Example
discord.on_thread_update = function(ctx) {
if (ctx.before && ctx.before.name !== ctx.after.name) {
ethone.log("Thread renamed: " + ctx.before.name + " -> " + ctx.after.name);
} else {
ethone.log("Thread updated: " + ctx.after.name);
}
};
discord.on_thread_delete
Fired when a thread is deleted.
Event Context
| Property | Type | Description |
|---|
ctx.thread | Channel | Thread channel object |
ctx.guild | Guild | Full guild object |
Example
discord.on_thread_delete = function(ctx) {
ethone.log("Thread deleted: " + ctx.thread.name);
};
discord.on_thread_list_sync
Fired when thread member lists are synchronized.
Event Context
| Property | Type | Description |
|---|
ctx.guild_id | string | Guild ID |
ctx.channel_ids | string[] | Array of channel IDs being synced |
ctx.threads | Channel[] | Array of thread objects |
ctx.members | ThreadMember[] | Array of thread member objects |
ctx.guild | Guild | Guild context |
Example
discord.on_thread_list_sync = function(ctx) {
ethone.log("Thread list synced: " + ctx.threads.length + " threads");
};
discord.on_thread_member_update
Fired when the current user’s thread member object is updated.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Thread ID |
ctx.guild_id | string | Guild ID |
ctx.user_id | string | User ID |
ctx.join_timestamp | string | When the user joined the thread |
ctx.flags | number | Thread member flags |
ctx.guild | Guild | Full guild object |
Example
discord.on_thread_member_update = function(ctx) {
ethone.log("Thread member updated in thread " + ctx.id);
};
discord.on_thread_members_update
Fired when members are added or removed from a thread.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Thread ID |
ctx.guild_id | string | Guild ID |
ctx.member_count | number | Approximate member count |
ctx.added_members | ThreadMember[] | Array of added members |
ctx.removed_member_ids | string[] | Array of removed member IDs |
ctx.guild | Guild | Full guild object |
Example
discord.on_thread_members_update = function(ctx) {
ethone.log("Thread members updated");
ethone.log(" Added: " + ctx.added_members.length);
ethone.log(" Removed: " + ctx.removed_member_ids.length);
};
Voice Events
discord.on_voice_state_update
Fired when a user’s voice state changes (joins/leaves voice channel, mutes, deafens, etc.).
Event Context
| Property | Type | Description |
|---|
ctx.after | object | Updated voice state with all properties |
ctx.before | object | Previous voice state (if cached) |
ctx.guild | Guild | Full guild object |
Example
discord.on_voice_state_update = function(ctx) {
var member = ctx.after.member;
if (!member) return;
if (ctx.before && !ctx.before.channel_id && ctx.after.channel_id) {
ethone.log(member.username + " joined voice");
} else if (ctx.before && ctx.before.channel_id && !ctx.after.channel_id) {
ethone.log(member.username + " left voice");
} else if (ctx.before && ctx.before.channel_id !== ctx.after.channel_id) {
ethone.log(member.username + " switched voice channels");
}
};
discord.on_voice_server_update
Fired when a voice server endpoint is updated.
Event Context
| Property | Type | Description |
|---|
ctx.token | string | Voice connection token |
ctx.guild_id | string | Guild ID |
ctx.endpoint | string | Voice server endpoint |
Example
discord.on_voice_server_update = function(ctx) {
ethone.log("Voice server updated for guild " + ctx.guild_id);
};
Typing & Presence Events
discord.on_typing_start
Fired when a user starts typing in a channel.
Event Context
| Property | Type | Description |
|---|
ctx.user | Author | Full user object |
ctx.channel | Channel | Full channel object |
ctx.guild | Guild | Full guild object |
ctx.timestamp | number | Unix timestamp |
Example
discord.on_typing_start = function(ctx) {
ethone.log(ctx.user.username + " is typing in #" + ctx.channel.name);
};
This event fires frequently. Use sparingly.
discord.on_presence_update
Fired when a user’s presence/status changes (online, offline, idle, etc.).
Event Context
| Property | Type | Description |
|---|
ctx.after | object | Updated presence with user, status, activities |
ctx.before | object | Previous presence state (if cached) |
ctx.guild | Guild | Full guild object |
Example
discord.on_presence_update = function(ctx) {
if (ctx.before && ctx.before.status !== ctx.after.status) {
ethone.log(ctx.after.user.username + ": " + ctx.before.status + " -> " + ctx.after.status);
}
if (ctx.after.activities && ctx.after.activities.length > 0) {
ethone.log(" Playing: " + ctx.after.activities[0].name);
}
};
This event fires frequently. Use sparingly.
discord.on_presences_replace
Fired when all presences are replaced (rare event during reconnection).
Event Context
| Property | Type | Description |
|---|
ctx.presences | Presence[] | Array of presence objects |
Example
discord.on_presences_replace = function(ctx) {
ethone.log("Presences replaced: " + ctx.presences.length + " presences received");
};
User & Relationship Events
discord.on_user_update
Fired when the current user’s account is updated (username, avatar, email, etc.).
Event Context
| Property | Type | Description |
|---|
ctx.after | Author | Updated user object |
ctx.before | Author | Previous user state (if cached) |
Example
discord.on_user_update = function(ctx) {
if (ctx.before && ctx.before.username !== ctx.after.username) {
ethone.log("Username changed: " + ctx.before.username + " -> " + ctx.after.username);
} else {
ethone.log("Your account was updated:");
ethone.log(" Username: " + ctx.after.username);
}
ethone.send_event("Account Updated", "Your Discord account settings changed", "info");
};
discord.on_relationship_add
Fired when a relationship is added (friend request sent/received, friend added, blocked user, etc.).
Event Context
| Property | Type | Description |
|---|
ctx.relationship.id | string | User ID of the relationship |
ctx.relationship.type | number | Relationship type (1=friend, 2=blocked, 3=incoming request, 4=outgoing request) |
ctx.relationship.user | Author | User object |
ctx.relationship.since | string | ISO timestamp of when relationship was created |
ctx.relationship.status | string | User’s current status |
Example
discord.on_relationship_add = function(ctx) {
var types = {1: "Friend", 2: "Blocked", 3: "Incoming Request", 4: "Outgoing Request"};
var type = types[ctx.relationship.type] || "Unknown";
ethone.log("Relationship added: " + ctx.relationship.user.username + " (" + type + ")");
};
discord.on_relationship_update
Fired when a relationship is updated (e.g., friend accepted, nickname changed, status changed).
Event Context
| Property | Type | Description |
|---|
ctx.after | object | Updated relationship with id, type, user, since, status |
ctx.before | object | Previous relationship state (if cached) |
Example
discord.on_relationship_update = function(ctx) {
var types = {1: "Friend", 2: "Blocked", 3: "Incoming Request", 4: "Outgoing Request"};
if (ctx.before && ctx.before.type !== ctx.after.type) {
var oldType = types[ctx.before.type] || "Unknown";
var newType = types[ctx.after.type] || "Unknown";
ethone.log("Relationship type changed: " + ctx.after.user.username + " (" + oldType + " -> " + newType + ")");
} else {
ethone.log("Relationship updated with " + ctx.after.user.username);
}
};
discord.on_relationship_remove
Fired when a relationship is removed (unfriended, unblocked, friend request cancelled/declined, etc.).
Event Context
Same structure as on_relationship_add.
Example
discord.on_relationship_remove = function(ctx) {
ethone.log("Relationship removed: " + ctx.relationship.user.username);
};
Call Events
discord.on_call_create
Fired when a call starts in a private channel or group DM.
Event Context
| Property | Type | Description |
|---|
ctx.channel_id | string | Channel ID |
ctx.message_id | string | Call message ID |
ctx.region | string | Voice region |
ctx.ringing | string[] | Array of user IDs being rung |
ctx.unavailable | boolean | Whether the call is unavailable |
ctx.channel | Channel | Full channel object |
Example
discord.on_call_create = function(ctx) {
ethone.log("Call started - ringing " + ctx.ringing.length + " users");
};
discord.on_call_update
Fired when a call state is updated.
Event Context
Same structure as on_call_create.
Example
discord.on_call_update = function(ctx) {
ethone.log("Call updated - ringing " + ctx.ringing.length + " users");
};
discord.on_call_delete
Fired when a call ends.
Event Context
| Property | Type | Description |
|---|
ctx.channel_id | string | Channel ID |
ctx.unavailable | boolean | Whether the call ended due to unavailability |
ctx.channel | Channel | Full channel object |
Example
discord.on_call_delete = function(ctx) {
ethone.log("Call ended");
};
Invite Events
discord.on_invite_create
Fired when an invite is created.
Event Context
| Property | Type | Description |
|---|
ctx.code | string | Invite code |
ctx.guild_id | string | Guild ID |
ctx.channel_id | string | Channel ID |
ctx.inviter | Author | User who created the invite |
ctx.created_at | string | Creation timestamp |
ctx.expires_at | string | Expiration timestamp |
ctx.max_age | number | Max age in seconds |
ctx.max_uses | number | Max number of uses |
ctx.temporary | boolean | Whether invite grants temporary membership |
ctx.uses | number | Number of times used |
ctx.guild | Guild | Full guild object |
ctx.channel | Channel | Full channel object |
Example
discord.on_invite_create = function(ctx) {
ethone.log("Invite created: " + ctx.code);
ethone.log(" By: " + ctx.inviter.username);
};
discord.on_invite_delete
Fired when an invite is deleted or expires.
Event Context
| Property | Type | Description |
|---|
ctx.code | string | Invite code |
ctx.guild_id | string | Guild ID |
ctx.channel_id | string | Channel ID |
ctx.guild | Guild | Full guild object |
ctx.channel | Channel | Full channel object |
Example
discord.on_invite_delete = function(ctx) {
ethone.log("Invite deleted: " + ctx.code);
};
Friend Suggestion Events
discord.on_friend_suggestion_create
Fired when Discord suggests a friend.
Event Context
| Property | Type | Description |
|---|
ctx.suggested_user | Author | Suggested user object |
ctx.reasons | Object[] | Array of suggestion reasons |
Example
discord.on_friend_suggestion_create = function(ctx) {
ethone.log("Friend suggestion: " + ctx.suggested_user.username);
};
discord.on_friend_suggestion_delete
Fired when a friend suggestion is removed.
Event Context
| Property | Type | Description |
|---|
ctx.suggested_user_id | string | ID of the suggested user |
Example
discord.on_friend_suggestion_delete = function(ctx) {
ethone.log("Friend suggestion removed: " + ctx.suggested_user_id);
};
Integration & Webhook Events
discord.on_integration_create
Fired when an integration is created in a guild.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Integration ID |
ctx.name | string | Integration name |
ctx.type | string | Integration type (twitch, youtube, discord, etc.) |
ctx.enabled | boolean | Whether the integration is enabled |
ctx.guild_id | string | Guild ID |
ctx.guild | Guild | Full guild object |
Example
discord.on_integration_create = function(ctx) {
ethone.log("Integration created: " + ctx.name + " (" + ctx.type + ")");
};
discord.on_integration_update
Fired when an integration is updated.
Event Context
| Property | Type | Description |
|---|
ctx.after | object | Updated integration object |
ctx.before | object | Previous integration state (if cached) |
ctx.guild | Guild | Full guild object |
Example
discord.on_integration_update = function(ctx) {
ethone.log("Integration updated: " + ctx.after.name);
};
discord.on_integration_delete
Fired when an integration is deleted.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Integration ID |
ctx.guild_id | string | Guild ID |
ctx.application_id | string | Application ID (if applicable) |
ctx.guild | Guild | Full guild object |
Example
discord.on_integration_delete = function(ctx) {
ethone.log("Integration deleted: " + ctx.id);
};
discord.on_webhooks_update
Fired when a guild’s webhooks are updated.
Event Context
| Property | Type | Description |
|---|
ctx.guild_id | string | Guild ID |
ctx.channel_id | string | Channel ID |
ctx.guild | Guild | Full guild object |
ctx.channel | Channel | Full channel object |
Example
discord.on_webhooks_update = function(ctx) {
ethone.log("Webhooks updated in #" + ctx.channel.name);
};
Auto Moderation Events
discord.on_auto_moderation_rule_create
Fired when an auto moderation rule is created.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Rule ID |
ctx.guild_id | string | Guild ID |
ctx.name | string | Rule name |
ctx.creator_id | string | User who created the rule |
ctx.event_type | number | Event type |
ctx.trigger_type | number | Trigger type |
ctx.enabled | boolean | Whether the rule is enabled |
ctx.guild | Guild | Full guild object |
Example
discord.on_auto_moderation_rule_create = function(ctx) {
ethone.log("AutoMod rule created: " + ctx.name);
};
discord.on_auto_moderation_rule_update
Fired when an auto moderation rule is updated.
Event Context
Same structure as on_auto_moderation_rule_create.
Example
discord.on_auto_moderation_rule_update = function(ctx) {
ethone.log("AutoMod rule updated: " + ctx.name);
};
discord.on_auto_moderation_rule_delete
Fired when an auto moderation rule is deleted.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Rule ID |
ctx.guild_id | string | Guild ID |
ctx.guild | Guild | Full guild object |
Example
discord.on_auto_moderation_rule_delete = function(ctx) {
ethone.log("AutoMod rule deleted");
};
discord.on_auto_moderation_action_execution
Fired when an auto moderation action is executed.
Event Context
| Property | Type | Description |
|---|
ctx.guild_id | string | Guild ID |
ctx.action | Object | Action that was executed |
ctx.rule_id | string | Rule ID that triggered |
ctx.user_id | string | User who triggered the rule |
ctx.channel_id | string | Channel ID (if applicable) |
ctx.message_id | string | Message ID (if applicable) |
ctx.matched_keyword | string | Keyword that was matched |
ctx.matched_content | string | Full matched content |
ctx.guild | Guild | Full guild object |
Example
discord.on_auto_moderation_action_execution = function(ctx) {
ethone.log("AutoMod triggered: " + ctx.matched_keyword);
};
Entitlement Events
discord.on_entitlement_create
Fired when an entitlement (subscription, premium purchase) is created.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Entitlement ID |
ctx.sku_id | string | SKU (product) ID |
ctx.application_id | string | Application ID |
ctx.user_id | string | User who owns the entitlement |
ctx.type | number | Entitlement type |
ctx.starts_at | string | Start timestamp |
ctx.ends_at | string | End timestamp |
Example
discord.on_entitlement_create = function(ctx) {
ethone.log("New entitlement: " + ctx.sku_id);
};
discord.on_entitlement_update
Fired when an entitlement is updated.
Event Context
Same structure as on_entitlement_create.
Example
discord.on_entitlement_update = function(ctx) {
ethone.log("Entitlement updated: " + ctx.id);
};
discord.on_entitlement_delete
Fired when an entitlement is deleted.
Event Context
Same structure as on_entitlement_create.
Example
discord.on_entitlement_delete = function(ctx) {
ethone.log("Entitlement deleted: " + ctx.id);
};
Guild Scheduled Events
discord.on_guild_scheduled_event_create
Fired when a guild scheduled event is created.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Event ID |
ctx.guild_id | string | Guild ID |
ctx.name | string | Event name |
ctx.description | string | Event description |
ctx.scheduled_start_time | string | Start timestamp |
ctx.scheduled_end_time | string | End timestamp |
ctx.creator_id | string | User who created the event |
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_scheduled_event_create = function(ctx) {
ethone.log("Scheduled event created: " + ctx.name);
};
discord.on_guild_scheduled_event_update
Fired when a guild scheduled event is updated.
Event Context
| Property | Type | Description |
|---|
ctx.after | object | Updated scheduled event object |
ctx.before | object | Previous scheduled event state (if cached) |
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_scheduled_event_update = function(ctx) {
if (ctx.before && ctx.before.name !== ctx.after.name) {
ethone.log("Event renamed: " + ctx.before.name + " -> " + ctx.after.name);
} else {
ethone.log("Scheduled event updated: " + ctx.after.name);
}
};
discord.on_guild_scheduled_event_delete
Fired when a guild scheduled event is deleted.
Event Context
Same structure as on_guild_scheduled_event_create.
Example
discord.on_guild_scheduled_event_delete = function(ctx) {
ethone.log("Scheduled event deleted: " + ctx.name);
};
discord.on_guild_scheduled_event_user_add
Fired when a user subscribes to a guild scheduled event.
Event Context
| Property | Type | Description |
|---|
ctx.guild_scheduled_event_id | string | Event ID |
ctx.user_id | string | User ID |
ctx.guild_id | string | Guild ID |
ctx.guild | Guild | Full guild object |
Example
discord.on_guild_scheduled_event_user_add = function(ctx) {
ethone.log("User subscribed to event");
};
discord.on_guild_scheduled_event_user_remove
Fired when a user unsubscribes from a guild scheduled event.
Event Context
Same structure as on_guild_scheduled_event_user_add.
Example
discord.on_guild_scheduled_event_user_remove = function(ctx) {
ethone.log("User unsubscribed from event");
};
Stage Instance Events
discord.on_stage_instance_create
Fired when a stage instance is created.
Event Context
| Property | Type | Description |
|---|
ctx.id | string | Stage instance ID |
ctx.guild_id | string | Guild ID |
ctx.channel_id | string | Channel ID |
ctx.topic | string | Stage topic |
ctx.privacy_level | number | Privacy level |
ctx.guild | Guild | Guild context |
ctx.channel | Channel | Channel context |
Example
discord.on_stage_instance_create = function(ctx) {
ethone.log("Stage started: " + ctx.topic);
};
discord.on_stage_instance_update
Fired when a stage instance is updated.
Event Context
Same structure as on_stage_instance_create.
Example
discord.on_stage_instance_update = function(ctx) {
ethone.log("Stage updated: " + ctx.topic);
};
discord.on_stage_instance_delete
Fired when a stage instance is deleted.
Event Context
Same structure as on_stage_instance_create.
Example
discord.on_stage_instance_delete = function(ctx) {
ethone.log("Stage ended");
};
Audit Log & System Events
discord.on_guild_audit_log_entry_create
Fired when a new audit log entry is created in a guild.
Event Context
| Property | Type | Description |
|---|
ctx.guild_id | string | The guild ID |
ctx.entry.id | string | Entry ID |
ctx.entry.action_type | number | Type of action performed |
ctx.entry.user_id | string | User who performed the action |
ctx.entry.target_id | string | Target of the action |
ctx.entry.reason | string | Reason for the action |
ctx.guild | Guild | Guild context |
Example
discord.on_guild_audit_log_entry_create = function(ctx) {
ethone.log("Audit log entry created by " + ctx.entry.user_id);
};