# Member Count

### Setting up the Voice Channel

In your server, create a voice channel, name this as you wish and change the channel permission so no one can join the voice channel.

{% hint style="warning" %}
Anyone with the `ADMINISTRATOR` permission can join / view any channel within your server.
{% endhint %}

<figure><img src="/files/i3W573bmNUkYGIBwOmno" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Member Joins" %}

### Initialising the Event

Create a Discord Event with the name '**When a member joins a guild**', you can nickname this event anything you wish. For this guide we will nickname it 'Join - Member count'

<figure><img src="/files/ebwBVzF72zh48gYi0gvW" alt=""><figcaption><p>Image shows the Discord Event filled in correctly.</p></figcaption></figure>

### Editing the Voice Channel

Connect a 'Edit channel' block to your event tree and follow the structure below:

<figure><img src="/files/XTIYTnPK8qmHcWgTG4CR" alt=""><figcaption><p>Image shows what the event will look like.</p></figcaption></figure>

#### Channel Type

Channel ID / Variable

#### Channel ID

This is the channel ID of your voice channel.

<figure><img src="/files/H8VLWmeoFpemn1f9VS1h" alt=""><figcaption></figcaption></figure>

#### Channel Name

**Member count: {interaction\[guild.memberCount]}**

#### Category (Optional)

The category you would like to put the voice channel under.

<figure><img src="/files/Cjf82mzhPw7q1WqYvIv9" alt=""><figcaption></figcaption></figure>

#### Channel Topic (Optional)

The topic for your channel - For this guide we wont have a channel topic.

<figure><img src="/files/HRmI2m6dTXjs6XoDZz20" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
All of the fields show in the image above are optional, and we wont need them for this guide.
{% endhint %}

{% hint style="success" %}
Save your event and your statistics channel will now update when a user joins!
{% endhint %}

<figure><img src="/files/yUDpOFfuCcoCfGLt0yrv" alt=""><figcaption><p>Video shows what happens when a user joins the guild.</p></figcaption></figure>
{% endtab %}

{% tab title="Member leaves" %}

### Initialising the Event

Create a Discord Event with the name '**When a member leaves a guild or is kicked**', you can nickname this event anything you wish. For this guide we will nickname it 'Leave - Member update'

<figure><img src="/files/LIsxIn25tXBlDBR85PQ4" alt=""><figcaption></figcaption></figure>

### Editing the Voice Channel

Connect a 'Edit channel' block to your event tree and follow the structure below:

<figure><img src="/files/ROg7KWrWU1VZpjhAf8va" alt=""><figcaption></figcaption></figure>

#### Channel Type

Channel ID / Variable

#### Channel ID

This is the channel ID of your voice channel.

<figure><img src="/files/H8VLWmeoFpemn1f9VS1h" alt=""><figcaption></figcaption></figure>

#### Channel Name

**Member count: {interaction\[guild.memberCount]}**

#### Category (Optional)

The category you would like to put the voice channel under.

<figure><img src="/files/Cjf82mzhPw7q1WqYvIv9" alt=""><figcaption></figcaption></figure>

#### Channel Topic (Optional)

The topic for your channel - For this guide we wont have a channel topic.

<figure><img src="/files/HRmI2m6dTXjs6XoDZz20" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
All of the fields show in the image above are optional, and we wont need them for this guide.
{% endhint %}
{% endtab %}
{% endtabs %}

Once you have added either or both events to your bot you can can see the voice channel will update when a member joins & leaves your server!

{% hint style="success" %}
That is the event officially setup, if you have any other questions related to botwiz or about this guide feel free to visit our [Support Server](https://discord.gg/5qRpsctzjB)!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.botwiz.dev/botwiz-guides/botwiz-guides-1/server-statistics/member-count.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
