Events

Discord Events

These events are specifically triggered once a Discord-related action has taken place. When setting up a Discord event, you will have a wide range of options to choose from, e.g. an event for when a user has joined a server your bot is a member of.

In each Discord event, you can access specific variables such as {added_member}. These will be unique to the event, and allow you to access information such as the new member's username. Each Discord event, and variable, is linked to the Discord JS Documentation.

To find a full list of Discord events available at BotWiz, see List of Discord Events.

To find out more about Discord's JS Documentation, see Discord JS.

Creating a Discord Event

When creating a new Discord event, you must select an event type. This is for when the event will be triggered, such as for when a role has been created. Additionally, you can set a nickname for the event. This will allow you to keep track of your events, and what they do.

Discord events can be used to create welcomer messages, auto-roles for new members, logging messages for actions such as for when a member has been kicked, and much more! To get started on events like these, see our BotWiz Guides.

Timed Events

Timed events allow you to run custom actions at a scheduled time or time interval. For instance, you can send a message everyday at 6pm your local time. Timed events work like other builders, allowing you to use action and condition blocks, but since this is an event, options can not be used.

Creating a Timed Event

When starting a new timed event, there are only a few options. Firstly, you'll want to select which guild this event will run in and then you can toggle whether this event should run as an interval or on a schedule. Also, with each timed event, you can always set a name.

For an interval, you can input the seconds, minutes, hours or days. To whichever interval you set, this means that the event will trigger every x time set, e.g, if the interval is set to 30 minutes, the event will run every 30 minutes. Do note however, intervals must have at least 30 seconds to work.

For a scheduled event, this will run every day at x time you set at the timezone you select. For scheduled events, you can pick to have your bot send a message at 11:00 and 12:00 each day for example. This can be useful for auto-purging channels for instance.

Timed events are not entirely accurate as delays may occur. Please be mindful.

Webhook Events

Webhooks allow you to communicate with third-party services, for setting up systems such as Discord Status updates, or custom reminders. Webhooks are fairly complicated as you will need an understanding of APIs in order to fully configure a webhook. Please see API to find out more.

Without a third party, a webhook can be used for common events such as a counting channel. Meaning, webhooks can be used to just send a message, imposing the user as a bot, as shown below.

Third-Party Requests

For each API request you make, you must use your Webhook Authorization Key as authorization. You can find this key in your bot's Settings > Data & Security. When sending a request, you must have a webhook event set up. You can find your webhook URL at your webhook events page.

If you choose to enter any variables in your API request's body, you can use {interaction[variable_name]} for example.

POST URL: https://webhook.botwiz.dev/BOT_ID/WEBHOOK_EVENT_TOKEN Content-Type: application/json Authorization: WEBHOOK_KEY Body: {

"Variable_name”: “variable value”, "Variable_name2”: “variable value2”, }

Only 6 requests a minute can be submitted.

Custom Events

Custom events allow you to run an event outside of a command. For instance, during your command you can run a custom event, which could be for a logging system. Custom events can be triggered from any command, meaning multiple commands can run a custom event.

When starting a custom event, you can pass over data from your command into your event. To refer to this information, you can use the {interaction} variable in your custom event.

Creating a new custom event will prompt you to set a name. This is entirely optional, but recommended if you have multiple custom events; allowing you to distinguish their functions.

Last updated