> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dogebot.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Bot, alerts and other events

> Events about your bot itself, YouTube, Twitch and TikTok alerts, webhooks, Discord AutoMod and the audit log.

These run for things about your bot itself, YouTube, Twitch and TikTok alerts, webhooks, Discord AutoMod and the audit log.

> **Example**
>
> Set your bot's status every time it starts, or post when your favourite YouTuber uploads.

## Bot events

> **When the bot starts or is restarted**
>
> **When it runs:** every time your bot turns on.
>
> **Variables:** none.
>
> **Build idea:** a great place for a **Bot status** block, so your bot always shows the right status.

> **When the bot joins a server**
>
> **When it runs:** your bot is added to a server.
>
> | Type this | What you get |
> | - | - |
> | `{event_guild_id}` | The server ID |
> | `{event_guild_name}` | The server name |
> | `{event_guild_members}` | How many members it has |

> **When the bot leaves a server**
>
> **When it runs:** your bot leaves or is removed from a server.
>
> **Variables:** `{event_guild_id}` and `{event_guild_name}`.

> **When a custom variable's value changes**
>
> **When it runs:** one of **your own variables** changes.
>
> | Type this | What you get |
> | - | - |
> | `{event_variable_name}` | Which variable changed |
> | `{event_variable_old_value}` | The value before |
> | `{event_variable_new_value}` | The value now |
> | `{event_variable_user_id}` | The member it changed for (User variables) |
> | `{event_variable_key}` | The key that changed (objects) |
> | `{event_guild_id}` | The server ID |
>
> **Build idea:** when someone reaches 1000 coins, give them a role.

> **When the bot is updated through the dashboard**
>
> **When it runs:** you save changes on the dashboard.
>
> **Variables:** `{event_update_type}`, which says what changed.

## Social alerts

First choose **who to watch** in **Integrations**. See [YouTube, Twitch and TikTok alerts](/connections/youtube-twitch-and-tiktok-alerts) for every variable these give you.

![The DogeBot Integrations page](https://mintcdn.com/doge-bot/0C6-zgXTpDx1QOCe/images/guide/integrations.png?fit=max\&auto=format\&n=0C6-zgXTpDx1QOCe\&q=85\&s=026c094121d3e7f591cbf1ec107a0954)

> **When a YouTube channel uploads a video**
>
> **When it runs:** a new video or live stream appears.
>
> **Build idea:** post the new video in your announcements channel.

> **When a Twitch channel goes live**
>
> **When it runs:** the streamer starts streaming.
>
> **Build idea:** ping your stream fans role.

> **When a TikTok account posts**
>
> **When it runs:** a new TikTok is posted.

## Webhooks

> **When a webhook is executed**
>
> **When it runs:** another website sends data to your bot's webhook link.
>
> **Variables:** everything it sends arrives as `{webhook_...}` variables. See [Inbound webhooks](/connections/inbound-webhooks).
>
> **Build idea:** post a message in Discord when someone buys from your online shop.

## Discord AutoMod

These work with Discord's own AutoMod (Server Settings, then AutoMod).

> **Auto Moderation Action Executed**
>
> **When it runs:** AutoMod blocks a message or acts on someone.
>
> | Type this | What you get |
> | - | - |
> | `{event_user_id}`, `{event_user_name}`, `{event_user_mention}` | Who broke the rule |
> | `{event_action_type}` | What AutoMod did |
> | `{event_channel_id}` | Where it happened |
> | `{event_matched_content}` | The words that broke the rule |
> | `{event_matched_keyword}` | The rule word it matched |
> | `{event_message_content}` | The whole message |
> | `{event_message_id}` | The message ID |
> | `{event_rule_id}` | The rule ID |
> | `{event_rule_trigger_type}` | What kind of rule |
>
> **Build idea:** post what was blocked in your staff log channel.

> **Auto Moderation Rule Created, Updated or Deleted**
>
> **When it runs:** an AutoMod rule is made, changed or removed.
>
> | Type this | What you get |
> | - | - |
> | `{event_rule_id}` | The rule ID |
> | `{event_rule_name}` | The rule name |
> | `{event_rule_enabled}` | true if the rule is on |
> | `{event_rule_trigger_type}` | What kind of rule |
> | `{event_guild_id}`, `{event_guild_name}` | The server |

## Audit log

> **Audit Log Entry Created**
>
> **When it runs:** anything is written to the server's audit log (bans, role changes, channel changes and more).
>
> > [!WARNING]
> >
> > Your bot needs the **View Audit Log** permission.
>
> | Type this | What you get |
> | - | - |
> | `{event_audit_action}` | What happened, in words |
> | `{event_audit_action_type}` | The type of action |
> | `{event_audit_executor_id}` | Who did it |
> | `{event_audit_target_id}` | What it was done to |
> | `{event_audit_target_type}` | What kind of thing it was done to |
> | `{event_audit_reason}` | The reason given |
>
> **Build idea:** one log channel that shows everything your staff do.

## Application events

> **Application Command Permissions Updated**
>
> **When it runs:** someone changes who can use your bot's commands in Server Settings.
>
> **Variables:** `{event_application_id}`, `{event_command_id}` and the server variables.

## Example

Under **When a custom variable's value changes**, a message block in your log channel says:

```text theme={null}
{event_variable_name} changed from {event_variable_old_value} to {event_variable_new_value}
```

The bot shows: **coins changed from 950 to 1000**

Add a **Compare** check above the message if you only want it for one variable, for example `{event_variable_name}` **Equal to** `coins`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.