Discord API¶
The Discord API provides a set of operations for interacting with Discord webhooks and messages, allowing users to send, edit, pin, and delete messages.
Why Integrate Discord with EasyTask?¶
Integrating Discord with EasyTask enables you to automate messaging and notification workflows across your team channels. This integration allows you to:
- Automate Notifications: Send, edit, and manage Discord messages automatically as part of your EasyTask workflows, keeping your team informed in real time.
- Manage Webhooks Programmatically: Create, configure, and update Discord webhooks through EasyTask orchestration without manual intervention.
- Streamline Channel Operations: Pin important messages, retrieve message history, and clean up channels automatically as part of your automated processes.
Required Values in Vault¶
Example Usage¶
curl -X POST http://localhost:8008/run-integration \
-H "Content-Type: application/json" \
-d '{
"is_credentials": {
"userid": "test",
"passwd": "test123"
},
"integration": "discord",
"uuid": "ae0e8ba9-423a-410e-bba5-e1933ff868c5",
"init": {
"vault_path_key": "discord/secret"
},
"action": [
{
"use_webhook": {
"webhook_url": "https://discord.com/api/webhooks/123456789/abcdefghijklmnop"
}
}
]
}'
Functions¶
use_webhook¶
use_webhook: This function sets the webhook URL for subsequent operations.
get_webhook_info¶
get_webhook_info: This function retrieves information about the current webhook.
get_all_webhooks¶
get_all_webhooks: This function retrieves information about all webhooks in the channel.
update_webhook¶
update_webhook: This function updates the name of the current webhook.
send_message¶
send_message: This function sends a message to the Discord channel.
get_message¶
get_message: This function retrieves a specific message by its ID.
edit_message¶
edit_message: This function edits an existing message.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| message_id | str | ID of the message to edit | yes |
| new_message | str | New content for the message | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | dict | Dictionary containing updated message information |
pin_message¶
pin_message: This function pins a message in the channel.
get_pinned_messages¶
get_pinned_messages: This function retrieves all pinned messages in the channel.
unpin_message¶
unpin_message: This function unpins a message from the channel.
delete_message¶
delete_message: This function deletes a message from the channel.
Frequently Asked Questions¶
How do I configure Discord credentials in EasyTask?¶
Use the EasyTask vault system to securely store your Discord bot token and channel ID. Navigate to the integration configuration page and add your credentials under a vault key like discord/secret.
Can I use Discord with both EasyTask Cloud and On-Premises?¶
Yes, Discord works seamlessly with both EasyTask Cloud and On-Premises deployments. The configuration process is identical since Discord is a cloud-based service.
How do I troubleshoot Discord connection issues?¶
Check the integration server logs in EasyTask for detailed error messages. Verify your bot token and channel ID in the vault, ensure the Discord API is accessible from the integration server, and test connectivity using the built-in connection test feature.