# Events

An event is a callback function that is invoked when something happens with your bot or the surrounding world.

Callbacks are set using the `on()` function:

```javascript
Bot.on("instant_message", function(data) {
  console.log("bot got a message:", data);
});
```

## Events Reference

| **Messaging** |
|-----------|
| [chat_message](/doc/fd0e059f-9f54-4bd2-b429-43341407e31e) |
| [instant_message](/doc/ee8fe98b-27c5-4b69-a9d1-4cdbc80b884e) |
| [start_typing](/doc/85c0481d-e501-4d29-9218-a3065d109cbc) |
| [stop_typing](/doc/fc72fa50-9244-4446-a0ce-ac9a5fb81cfb) |
| [teleport_offer](/doc/97d8e29f-210e-4182-a6ca-39a9a45f6556) |
| **Group Messaging** |
| [group_offer](/doc/407ce36d-0717-45d9-a456-81e7ed147c7b) |
| [group_im](/doc/a7173722-688a-4850-94ca-f328b6ec404f) |
| [group_notice](/doc/ac4f4578-9319-4221-a22f-c0b7a148c63a) |
| **Inventory** |
| [inventory_offer](/doc/e92f3367-ab0d-4b6f-82b7-5b63dd406594) |
| [balance_changed](/doc/c4e86272-4ec5-4bf3-bff6-eaa09e24ee7c) |
| **Friendship** |
| [friendship_offer](/doc/bad695b2-d58e-42a9-a740-f0ab3713bf00) |
| **Movement** |
| [autopilot_completed](/doc/78a839cb-375e-4f9d-bf41-e56ac13abf7f) |
| [autopilot_started](/doc/9dd16f98-ef68-4d73-8286-0a680bf576a8) |
| [autopilot_stuck](/doc/8cd48934-ce20-4c79-907a-228ec0de99a7) |
| [self_position](/doc/6967ce73-83ab-4df2-9e4f-cdc2ffec736b) |
| [sit](/doc/8021da51-66be-4d91-ac61-8761a5ad317e) |
| [teleport_status](/doc/a6e9b4cf-62b7-4ab9-b7ab-9ac55eca08ad) |
| **World** |
| [avatar_tracker_update](/doc/606b5d38-4a18-4388-aaae-39fb8597b763) |
| [region_restart](/doc/6e801676-ce7b-4ef5-8f16-b90682385233) |
| [region_restart_cancelled](/doc/a23ca0da-f077-4076-bb71-bbfdb5eadb49) |
| [script_dialog](/doc/6fd62b40-3e6d-4a86-8b46-c7572e14948a) |
| **Online Status** |
| [before_login](/doc/2d7cba90-0b09-4e16-812c-514c120146c7) |
| [after_login](/doc/dcff4861-19bd-422f-a830-1508398d27a2) |
| [before_logout](/doc/9067d88b-20f4-4b65-ad94-6e4a8c175b20) |
| [after_logout](/doc/a9758dea-0f05-4d3e-a9de-79460b451367) |
| [login_error](/doc/4c6b4679-543d-418d-bd9e-8be88148f8d0) |
| **Webhooks** |
| [playground_webhook](/doc/73d8b4d0-2d66-4c87-af1c-c6d8bbd989e5) |

---

**Documents**

- [autopilot_completed](https://www.mysmartbots.com/docs/s/dev/doc/autopilot_completed-kponD1mhiR)
- [autopilot_stuck](https://www.mysmartbots.com/docs/s/dev/doc/autopilot_stuck-kIASNXyYXk)
- [after_login](https://www.mysmartbots.com/docs/s/dev/doc/after_login-x0Lp4gufxn)
- [after_logout](https://www.mysmartbots.com/docs/s/dev/doc/after_logout-apIluhuxSy)
- [script_dialog](https://www.mysmartbots.com/docs/s/dev/doc/script_dialog-o1yLggCikh)
- [self_position](https://www.mysmartbots.com/docs/s/dev/doc/self_position-RjaYS7eHiY)
- [sit](https://www.mysmartbots.com/docs/s/dev/doc/sit-gAp6slcsvf)
- [instant_message](https://www.mysmartbots.com/docs/s/dev/doc/instant_message-91xT3xPMy3)
- [inventory_offer](https://www.mysmartbots.com/docs/s/dev/doc/inventory_offer-XNDV1IxOBa)
- [login_error](https://www.mysmartbots.com/docs/s/dev/doc/login_error-YpsaMmlXyy)
- [group_im](https://www.mysmartbots.com/docs/s/dev/doc/group_im-XlB0dalBij)
- [group_notice](https://www.mysmartbots.com/docs/s/dev/doc/group_notice-gjDSlpfHKw)
- [group_offer](https://www.mysmartbots.com/docs/s/dev/doc/group_offer-RPDYg0piHR)
- [teleport_status](https://www.mysmartbots.com/docs/s/dev/doc/teleport_status-ItLJWW2RIE)
- [autopilot_started](https://www.mysmartbots.com/docs/s/dev/doc/autopilot_started-tkN7y7eAwj)
- [avatar_tracker_update](https://www.mysmartbots.com/docs/s/dev/doc/avatar_tracker_update-wfVmQPC3qm)
- [balance_changed](https://www.mysmartbots.com/docs/s/dev/doc/balance_changed-DZOwcLhalq)
- [before_login](https://www.mysmartbots.com/docs/s/dev/doc/before_login-EFGTMXKu2O)
- [start_typing](https://www.mysmartbots.com/docs/s/dev/doc/start_typing-5aKwe7wSNG)
- [stop_typing](https://www.mysmartbots.com/docs/s/dev/doc/stop_typing-VZQBr56iCf)
- [teleport_offer](https://www.mysmartbots.com/docs/s/dev/doc/teleport_offer-aDduQo9WwP)
- [playground_webhook](https://www.mysmartbots.com/docs/s/dev/doc/playground_webhook-ZVpGpwI058)
- [region_restart](https://www.mysmartbots.com/docs/s/dev/doc/region_restart-NuCzKwolhA)
- [region_restart_cancelled](https://www.mysmartbots.com/docs/s/dev/doc/region_restart_cancelled-MbeDIdaM9o)
- [before_logout](https://www.mysmartbots.com/docs/s/dev/doc/before_logout-NIYU3iCva0)
- [chat_message](https://www.mysmartbots.com/docs/s/dev/doc/chat_message-Iu4CeTwZ9J)
- [friendship_offer](https://www.mysmartbots.com/docs/s/dev/doc/friendship_offer-2mkvWRJM2C)