Events
Last updated
Last updated
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.
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.
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.
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.
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.
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, unlike other events, are triggered by your other creations. Useful for organizing a large command into multiple builds, custom events can be triggered from any command; meaning multiple commands can run a custom event.
A custom event is unique in comparison to other events, as it has its own block. This block is the one you use to trigger a custom event from inside of another creation (e.g., command or event).
You must have a custom event before using this block; so you have one to select from.
When using a custom event block, you can pass over data from your command into your event. To refer to any information you enter, you can use {interaction[name]}
in your custom event. Using the example format below, the 'name' can be 'member', or 'hello'.
All other interactions (e.g., {interaction[channel.id]}
), modal or unique variables can be used in your custom events as if you were editing the original build that triggers this event.
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 .