# Welcome & Leave

### Placeholders

Before setting up, note the placeholders you can use.

Example:

```yml
# {userName}: YouSeeMeRunning
# {user}: @YouSeeMeRunning
# {userTag}: YouSeeMeRunning#1234
# {userId}: 264032125496459265 - This is the ID
# {userBanner}: Displays their users banner in the image field  
# {UserCreation}: How old is their account? Discord timestamp 
# {guildName}: Guild Name
# {guildIcon}: Guild Icon
# {memberCount}: Guild Member Count - 1st, 2nd, 3rd, 4th...
# {memberCountNumeric}: Displays 5, 6, 7...
# {longTime}: March 1st, 2023
# {shortTime}: 17:00
# {user-joinedAt}: For leave messages, displays when they first joined
# {user-createdAt}: The date when the user's Discord account was created
# {autoKickTime}: How long until the user is kicked
# {invitedBy}: Who invited them?
# {invitedByCount}: How many invites the person who invited them has
# {joinDate} # Discord timestamp for when they joined
# {joinTime} # Discord timestamp for when they joined
# {leaveDate} # Discord timestamp for when they left
# {leaveTime} # Discord timestamp for when they left
```

Use these in your `Text`, `Embed.Description`, `Footer`, etc.

***

### Welcome Messages

#### Core Settings

```yml
WelcomeMessage:
  Enabled: false
  ChannelID: "CHANNEL_ID"
  Type: "BOTH" # EMBED, MESSAGE, BOTH
  Text: "Welcome to **{guildName}**, {userName}"
```

* **Enabled** → Master switch for welcome system
* **ChannelID** → Channel where messages will be sent
* **Type** →
  * `MESSAGE` = text only
  * `EMBED` = embed only
  * `BOTH` = show both, embed and text.

***

#### Embed Options

{% code expandable="true" %}

```yml
Embed:
  Title: ""
  Description:
    - "Welcome to **{guildName}**, {userName}! 🎉"
    - "Invited By » {invitedBy} ({invitedByCount} invites)"
    - "Join Date » {joinDate} ({joinTime})"
    - "Account Age » {UserCreation}"
    - "Members » {memberCount} member"
  Footer:
    Text: "{guildName} • Today at {shortTime}"
    Icon: "{guildIcon}"
  Author:
    Text: "Welcome to {guildName}!"
    Icon: "https://.../hand-waving-icon.png"
  Color: "#1769FF"
  Image: "{userBanner}"
  Thumbnail: "{user-avatar}"
  Buttons:
    - Type: "LINK"
      Name: "Product"
      Emoji: "📜"
      Link: "https://builtbybit.com/..."
```

{% endcode %}

* **Description** → Multiple lines supported
* **Images/Thumbnails** → Use placeholders like `{user-avatar}`, `{userBanner}`
* **Buttons** → Add useful links (e.g., rules, website, product page)

***

#### Direct Message (DM) Welcome

{% code expandable="true" %}

```yml
DM:
  Enabled: false
  Embed:
    Title: "Welcome, {userName}!"
    Description:
      - "Welcome to **{guildName}**, {userName}! 🎉"
      - "You are our {memberCount} member!"
    Footer:
      Text: "{guildName} • Today at {shortTime}"
      Icon: "{guildIcon}"
    Color: "#1769FF"
    Image: "{userBanner}"
    Thumbnail: "{user-avatar}"
```

{% endcode %}

* Sends a private DM to each new member.
* Great for onboarding or linking rules.
* ⚠️ Some users disable server DMs → not a bug.

***

#### Auto-Delete System

```yml
AutoDelete:
  Enabled: false
  Delay: "15s"
```

* Deletes welcome messages after set time.
* **Delay** accepts: `10s`, `1m`, `1h`, `1d`.
* Useful for keeping your welcome channel clean.

***

### Leave Messages

#### Core Settings

```yml
LeaveMessage:
  Enabled: false
  ChannelID: "CHANNEL_ID"
  Type: "BOTH"
  Text: "Goodbye, {userName}!"
```

* **Enabled** → Master switch for leave system
* **ChannelID** → Where the leave message is posted
* **Type** → `MESSAGE`, `EMBED`, or `BOTH`

***

#### Embed Options

{% code expandable="true" %}

```yml
Embed:
  Description:
    - "Goodbye, {userName}!"
    - "Hope to see you again soon...."
  Footer:
    Text: "{guildName} • {shortTime}"
    Icon: "{guildIcon}"
  Author:
    Text: "👋 See you soon!"
  Color: "#1769FF"
  Thumbnail: "{user-avatar}"
```

{% endcode %}

* Keeps your farewell messages consistent with your welcome style.
* Use `{user-joinedAt}` to remind how long they were part of the server.

***

#### Auto-Delete System

```yml
AutoDelete:
  Enabled: false
  Delay: "15s"
```

* Works the same as the welcome auto-delete.
* Helpful for servers that want clean logs without permanent goodbye posts.

***

### Best Practices

* **Message design** → Keep it warm, friendly, and on-brand.
* **Channel management** → Use a dedicated `#welcome` or `#farewell` channel.
* **Invite tracking** → `{invitedBy}` only works if invite tracking is enabled.

***

### Common Issues

* **“Messages not showing”** → Make sure `Enabled: true` and bot has send/embed perms.
* **“Placeholders not working”** → They are case-sensitive, e.g., `{userName}` not `{username}`.
* **“Images not loading”** → Test the URL in a browser. Ensure that you right click the image and "Copy Image Address".
* **“DMs not delivered”** → Some users block DMs.
