Basic Webhook
Post messages to a Discord channel with webhooks

Basic Webhook Dialog
If you have not already configured a Webhook for your Discord server, check out the
Discord configuration guide to learn how.
Parameters
Webhook Name
Text required
Enter a name for your Webhook
Variables are not supported
Username
Text
Default:
Username configured in Discord Webhook settings
Set a custom username for the author of the resulting Discord message
Webhook URL
Text required
Enter the Webhook URL copied from the Discord webhook configuration
Variables are not supported
Content
Text required
Enter the text content for your webhook message. Multiple lines and variables are supported.
- Enable Developer Mode
Enable developer mode in Discord by opening settings and navigating toApp Settings -> Advanced
. Then, enable theDeveloper Mode
toggle. - User Pings
Users can be pinged in the following format:<@DISCORD_USER_ID>
e.g.<@0123456789>
With developer mode enabled, you can right-click on any user in discord, and clickCopy ID
to obtain their user ID. - Role Pings
Roles can be pinged in the following format:<@&DISCORD_ROLE_ID>
e.g.<@&0123456789>
With developer mode enabled, you can right-click on a role in the server settings area, and clickCopy ID
to obtain its ID.
Avatar URL
Text
Default:
Avatar configured in Discord Webhook settings
Set a custom avatar for the author of the resulting Discord message
For example, you could set it to a chat user's profile picture by using the Get User Info for Target Sub-Action and then using the %targetUserProfileImageUrl%
variable.
Text to Speech
Toggle
Toggle to send the message with Discord TTS
Variables
Name | Type | Description |
---|---|---|
Example Value: 1337117683476336600 Message Id of the Discord message |
C# Usage
Send simple text content to Discord webhook
public string DiscordPostTextToWebhook(string webhookUrl, string content, string username, string avatarUrl, bool textToSpeech = false)
webhookUrlstring required contentstring required usernamestringavatarUrlstringtextToSpeechbool
using System;
public class CPHInline
{
public bool Execute()
{
//Define your webhook url
string webhookUrl = "Write your webhook url in here";
//Set whether it should be textToSpeech in Discord when send
bool textToSpeech = false;
//Get user name of current user
CPH.TryGetArg("user",out string user);
//Get for example command input and set as content variable
CPH.TryGetArg("rawInput",out string content);
//Send Webhook message example, if needed you can save the messageId that gets returned (0.2.4+ only)
string messageId = CPH.DiscordPostTextToWebhook(webhookUrl, content, $"{user} said:", "", textToSpeech);
return true;
}
}