# Telegram Bot Button Styling & Custom Emoji Guide (Bot API 10.1)

In Telegram Bot API 9.4+, bots can style inline keyboard buttons using colors and attach custom emojis. This repository uses the following style configurations.

## 🎨 Available Button Styles

* **`primary`**: Dark blue button style. Used for primary or generic navigation links, actions, and features.
* **`success`**: Green button style. Used for positive actions (approve, enable, turn on, accept).
* **`danger`**: Red button style. Used for destructive actions (decline, delete, cancel, turn off, back).

---

## 🎭 Style & Custom Emoji Mappings

Below is the mapping configuration used by the automatic compiler to style buttons in the bot.

| Action Key / Match | Style | Custom Emoji ID | Target Custom Emoji | Description |
| :--- | :--- | :--- | :---: | :--- |
| `approve` | `success` | `5208880351690112495` | `✅` | Approvals / Joins / On / Unban |
| `have_joined` | `success` | `5208880351690112495` | `✅` | Join confirmation |
| `on` | `success` | `5208880351690112495` | `✅` | Turn service on |
| `unban_user` | `success` | `5208880351690112495` | `✅` | Admin unban |
| `invite_friends` | `success` | `5409008750893734809` | `👥` | Invitation link |
| `agent_one_buy` | `success` | `5208880351690112495` | `✅` | Buy single subscription |
| `agent_much_buy` | `success` | `5208880351690112495` | `✅` | Bulk subscription purchase |
| `renew_config` | `success` | `5208880351690112495` | `✅` | Configuration renewal |
| `decline` | `danger` | `5215680783863261658` | `❌` | Decline / Cancel / Rejections |
| `ban_user` | `danger` | `5215680783863261658` | `❌` | Admin ban user |
| `off` | `danger` | `5215680783863261658` | `❌` | Turn service off |
| `delete_config` | `danger` | `5215680783863261658` | `❌` | Destructive configuration deletion |
| `back_button` | `danger` | `5352759161945867747` | `🔙` | Go back to previous menu |
| `renew_connection_link` | `danger` | `5215680783863261658` | `❌` | Renew connection |
| `cancel` | `danger` | `5215680783863261658` | `❌` | General cancel operations |
| `back_to_main` | `danger` | `5352759161945867747` | `🔙` | Return to main menu |
| `pay_with_wallet` | `primary` | `5332600543963522398` | `👛` | Make purchase with wallet |
| `increase_wallet` | `primary` | `5332600543963522398` | `👛` | Deposit to wallet |
| `buy_subscriptions` | `primary` | `5388617496007817382` | `🛍` | Buy new subscriptions |
| `my_subscriptions` | `primary` | `5278467510604160626` | `💳` | Show active subscriptions |
| `my_info` | `primary` | `5409008750893734809` | `👥` | Show account statistics |
| `test_account` | `primary` | `5199749070830197566` | `🧪` | Request trial configuration |
| `sharj` | `primary` | `5213403875670765022` | `🔌` | Wallet recharge / Gateway |
| `cart_to_cart` | `primary` | `5213403875670765022` | `🔌` | Card to Card transfers |
| `gateways_settings` | `primary` | `5213403875670765022` | `🔌` | Configure payment gateways |
| `my_tickets` | `primary` | `5303138782004924588` | `🎫` | Open support tickets |
| `message_to_all` | `primary` | `5303138782004924588` | `🎫` | Admin broadcast text |
| `forward_to_all` | `primary` | `5303138782004924588` | `🎫` | Admin forward broadcast |
| `application_links` | `primary` | `5132131004097496494` | `🔗` | Download applications |
| `search_config` | `primary` | `5379999674193172777` | `🔍` | Search existing connections |
| `shared_existence` | `primary` | `5332600543963522398` | `👛` | Shared connection package |
| `individual_existence`| `primary` | `5332600543963522398` | `👛` | Dedicated connection package |
| `request_agency` | `primary` | `5332600543963522398` | `👛` | Apply for agency access |
| `agency_setting` | `primary` | `5332600543963522398` | `👛` | Manage agency configurations |
| `change_config_location`| `primary` | `5132131004097496494` | `🔗` | Modify location/region |
| `increase_config_volume`| `primary` | `5213403875670765022` | `🔌` | Buy additional traffic (GB) |
| `increase_config_days` | `primary` | `5213403875670765022` | `🔌` | Buy additional connection time |
| `update_config_connection`| `primary`| `5352759161945867747` | `🔙` | Regenerate connection configuration |

---

## 🚫 Critical Formatting Rule: Emojis

> [!WARNING]
> **DO NOT MIX EMOJIS! / از ایموجی‌های مخلوط استفاده نکنید!**
> When a custom emoji (`icon_custom_emoji_id`) is attached to an inline button, Telegram displays that custom emoji natively. You **must not** include any standard unicode emojis (like `❌`, `✅`, `🔙`, `👤`, etc.) in the text of the button.
>
> Doing so will result in two consecutive emojis, which looks unprofessional. The automatic inline keyboard compiler handles this by removing standard emojis automatically from styled buttons.

---

## 🛠️ PHP Code Helper Snippet

You can use the static helpers in `Bot\ButtonHelper` to generate standardized danger button rows:

```php
use Bot\ButtonHelper;

// Returns Cancel button configuration
$cancelBtn = ButtonHelper::cancelBtn('fa', 'انصراف', 'Cancel', 'main_menu');

// Returns Back button configuration
$backBtn = ButtonHelper::backBtn('fa', 'go_to_menu');
```
