# Guild.xyz --> Telegram

**Giving Hats Access to Telegram via Guild.xyz**

#### **1. Connect your Telegram channel to Guild**

If you're new to Guild, [follow steps 1-7 found here](https://help.guild.xyz/en/articles/6947585-how-to-gate-a-telegram-group).

If you already have a Guild set up, find your Guild, select "Add reward", and choose "Telegram". Then [follow steps 4-7 found here](https://help.guild.xyz/en/articles/6947585-how-to-gate-a-telegram-group).

![](/files/3csUe5LPu1gpz9yP6W1R)![](/files/jo1XBjgR13CrPa1Na4L6)

#### **2.Create a new role in Guild:**&#x20;

*If you already have a Guild role associated with this hat, you can skip this step.*

Navigate to your Guild and select "Add Role". We recommend creating a Guild role with the same name and image as the hat you want to associated it with.

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

#### **3. Add a requirement that an address must hold a specific hat token ID in order to claim that Guild role:**&#x20;

*If you have already associated that Guild role with the hat's token ID, you can skip this step.*&#x20;

Otherwise, within that Guild role, select "Add Requirement"

<div align="left"><figure><img src="/files/roXcSroVz36fnfl0eT8l" alt="" width="375"><figcaption></figcaption></figure></div>

Then select "NFT"

![](/files/gUgpXfSxg3WIHLVjpUtq)

Next, input the chain your hats are on, add the Hats Protocol contract address, select "Custom ID" under Requirement type, and enter the custom token ID associated with the hat. *See* [Permissions & Authorities](/hats-integrations/permissions-and-authorities.md#hats-protocol-contract-addresses-and-token-ids) *for details on how to find the Hats Protocol contract address and specific hat token IDs*.

![](/files/omltsPD6euvym9waI5x5)

Finally, select "Add requirement".&#x20;

This Guild role is now gated by the hat!

#### **4. Give that Guild role access to the Telegram channel you want to be associated with the hat:**

Within the Guild role, select "Add Reward", select "Add reward" within the Telegram box, and connect the Guild role to the Telegram channel by adding the Guild bot to your Telegram channel and following the instructions to enter the Telegram group ID provided by the bot.&#x20;

<div align="left"><figure><img src="/files/m5X24raJiLMuXT6XHEnU" alt="" width="375"><figcaption></figcaption></figure></div>

Save the Guild role. The hat now provides access to the designated Telegram channel via Guild!

*NOTE: Each Guild role can only grant access to one Telegram Channel. If you want to give a hat access to multiple Telegram channels, you will have to create multiple Guild roles associated with that hat.*

That's it, you're done! All hat wearers have to do to claim the authorities associated with their hat is to visit your Guild page and claim the applicable Guild role(s).

## Link your Hats tree to Guild to automatically display Guild authorities

This step will enable the Hats app to automatically detect and display Guild.xyz related authorities in your Hats tree:

{% hint style="info" %}
Skip this step if your tree's top-hat already includes the relevant Guild(s).
{% endhint %}

* Select "Edit Tree"
* Locate and select the tree's top-hat
* In the "Hat Basics" section, add the relevant Guilds. A Guild's name can be found in its URL. For example, if the Guild page is <https://guild.xyz/hats-protocol>, then its name is 'hats-protocol'.

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

Guild.xyz authorities will now be displayed on the relevant hats:

<figure><img src="/files/QW08TcJDa5OQ1XQdOYj2" alt="" width="563"><figcaption></figcaption></figure>


---

# 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.hatsprotocol.xyz/hats-integrations/permissions-and-authorities/telegram/guild.xyz-greater-than-telegram.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.
