Custom Scripts & Event Chains

Run custom JavaScript functions and triggers on specific server events (member join, role gain, boost).

Documentation / Server settings / Custom Scripts

  1. 1. Select Trigger

    Specify the event: guildMemberAdd, roleUpdate, messageReactionAdd, etc.

    Event: guildMemberAdd
  2. 2. Define Action

    Assign roles, send DMs, trigger webhooks, or write logs to the database.

    action: assignRole & sendWebhook
  3. 3. Run Live

    The script is executed safely in the Aegis-protected virtual working environment.

    Chain Completed

For custom server scenarios where standard bot features are not enough, the Aegis Custom Script engine allows you to run event-listener chains in a secure sandbox environment.

Example Script Logic

Example: Automatic VIP Role for Level 5 Memberjavascript
on('userLevelUp', async ({ user, newLevel, guild }) => {
  if (newLevel === 5) {
    await guild.members.cache.get(user.id)?.roles.add('VIP_ROLE_ID');
    await sendLog(guild, `🎉 ${user.tag} reached Level 5 and earned the VIP role!`);
  }
});

Secure scripts connected to the bot's internal event bus run in the background.