1. Packages
  2. Discord Provider
  3. API Docs
  4. Webhook
discord 2.0.0 published on Friday, Mar 7, 2025 by lucky3028

discord.Webhook

Explore with Pulumi AI

A resource to create a webhook for a channel.

Create Webhook Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Webhook(name: string, args: WebhookArgs, opts?: CustomResourceOptions);
@overload
def Webhook(resource_name: str,
            args: WebhookArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Webhook(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            channel_id: Optional[str] = None,
            avatar_data_uri: Optional[str] = None,
            avatar_url: Optional[str] = None,
            name: Optional[str] = None)
func NewWebhook(ctx *Context, name string, args WebhookArgs, opts ...ResourceOption) (*Webhook, error)
public Webhook(string name, WebhookArgs args, CustomResourceOptions? opts = null)
public Webhook(String name, WebhookArgs args)
public Webhook(String name, WebhookArgs args, CustomResourceOptions options)
type: discord:Webhook
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var webhookResource = new Discord.Webhook("webhookResource", new()
{
    ChannelId = "string",
    AvatarDataUri = "string",
    AvatarUrl = "string",
    Name = "string",
});
Copy
example, err := discord.NewWebhook(ctx, "webhookResource", &discord.WebhookArgs{
ChannelId: pulumi.String("string"),
AvatarDataUri: pulumi.String("string"),
AvatarUrl: pulumi.String("string"),
Name: pulumi.String("string"),
})
Copy
var webhookResource = new Webhook("webhookResource", WebhookArgs.builder()
    .channelId("string")
    .avatarDataUri("string")
    .avatarUrl("string")
    .name("string")
    .build());
Copy
webhook_resource = discord.Webhook("webhookResource",
    channel_id="string",
    avatar_data_uri="string",
    avatar_url="string",
    name="string")
Copy
const webhookResource = new discord.Webhook("webhookResource", {
    channelId: "string",
    avatarDataUri: "string",
    avatarUrl: "string",
    name: "string",
});
Copy
type: discord:Webhook
properties:
    avatarDataUri: string
    avatarUrl: string
    channelId: string
    name: string
Copy

Webhook Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Webhook resource accepts the following input properties:

ChannelId This property is required. string
ID of the channel to create a webhook for.
AvatarDataUri string
Data URI of an image to set as the default avatar of the webhook.
AvatarUrl string
Remote URL for setting the default avatar of the webhook.
Name string
Default name of the webhook.
ChannelId This property is required. string
ID of the channel to create a webhook for.
AvatarDataUri string
Data URI of an image to set as the default avatar of the webhook.
AvatarUrl string
Remote URL for setting the default avatar of the webhook.
Name string
Default name of the webhook.
channelId This property is required. String
ID of the channel to create a webhook for.
avatarDataUri String
Data URI of an image to set as the default avatar of the webhook.
avatarUrl String
Remote URL for setting the default avatar of the webhook.
name String
Default name of the webhook.
channelId This property is required. string
ID of the channel to create a webhook for.
avatarDataUri string
Data URI of an image to set as the default avatar of the webhook.
avatarUrl string
Remote URL for setting the default avatar of the webhook.
name string
Default name of the webhook.
channel_id This property is required. str
ID of the channel to create a webhook for.
avatar_data_uri str
Data URI of an image to set as the default avatar of the webhook.
avatar_url str
Remote URL for setting the default avatar of the webhook.
name str
Default name of the webhook.
channelId This property is required. String
ID of the channel to create a webhook for.
avatarDataUri String
Data URI of an image to set as the default avatar of the webhook.
avatarUrl String
Remote URL for setting the default avatar of the webhook.
name String
Default name of the webhook.

Outputs

All input properties are implicitly available as output properties. Additionally, the Webhook resource produces the following output properties:

AvatarHash string
Hash of the avatar.
GithubUrl string
The GitHub-compatible webhook URL.
Id string
The provider-assigned unique ID for this managed resource.
SlackUrl string
The Slack-compatible webhook URL.
Token string
The webhook token.
Url string
The webhook URL.
AvatarHash string
Hash of the avatar.
GithubUrl string
The GitHub-compatible webhook URL.
Id string
The provider-assigned unique ID for this managed resource.
SlackUrl string
The Slack-compatible webhook URL.
Token string
The webhook token.
Url string
The webhook URL.
avatarHash String
Hash of the avatar.
githubUrl String
The GitHub-compatible webhook URL.
id String
The provider-assigned unique ID for this managed resource.
slackUrl String
The Slack-compatible webhook URL.
token String
The webhook token.
url String
The webhook URL.
avatarHash string
Hash of the avatar.
githubUrl string
The GitHub-compatible webhook URL.
id string
The provider-assigned unique ID for this managed resource.
slackUrl string
The Slack-compatible webhook URL.
token string
The webhook token.
url string
The webhook URL.
avatar_hash str
Hash of the avatar.
github_url str
The GitHub-compatible webhook URL.
id str
The provider-assigned unique ID for this managed resource.
slack_url str
The Slack-compatible webhook URL.
token str
The webhook token.
url str
The webhook URL.
avatarHash String
Hash of the avatar.
githubUrl String
The GitHub-compatible webhook URL.
id String
The provider-assigned unique ID for this managed resource.
slackUrl String
The Slack-compatible webhook URL.
token String
The webhook token.
url String
The webhook URL.

Look up Existing Webhook Resource

Get an existing Webhook resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: WebhookState, opts?: CustomResourceOptions): Webhook
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        avatar_data_uri: Optional[str] = None,
        avatar_hash: Optional[str] = None,
        avatar_url: Optional[str] = None,
        channel_id: Optional[str] = None,
        github_url: Optional[str] = None,
        name: Optional[str] = None,
        slack_url: Optional[str] = None,
        token: Optional[str] = None,
        url: Optional[str] = None) -> Webhook
func GetWebhook(ctx *Context, name string, id IDInput, state *WebhookState, opts ...ResourceOption) (*Webhook, error)
public static Webhook Get(string name, Input<string> id, WebhookState? state, CustomResourceOptions? opts = null)
public static Webhook get(String name, Output<String> id, WebhookState state, CustomResourceOptions options)
resources:  _:    type: discord:Webhook    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AvatarDataUri string
Data URI of an image to set as the default avatar of the webhook.
AvatarHash string
Hash of the avatar.
AvatarUrl string
Remote URL for setting the default avatar of the webhook.
ChannelId string
ID of the channel to create a webhook for.
GithubUrl string
The GitHub-compatible webhook URL.
Name string
Default name of the webhook.
SlackUrl string
The Slack-compatible webhook URL.
Token string
The webhook token.
Url string
The webhook URL.
AvatarDataUri string
Data URI of an image to set as the default avatar of the webhook.
AvatarHash string
Hash of the avatar.
AvatarUrl string
Remote URL for setting the default avatar of the webhook.
ChannelId string
ID of the channel to create a webhook for.
GithubUrl string
The GitHub-compatible webhook URL.
Name string
Default name of the webhook.
SlackUrl string
The Slack-compatible webhook URL.
Token string
The webhook token.
Url string
The webhook URL.
avatarDataUri String
Data URI of an image to set as the default avatar of the webhook.
avatarHash String
Hash of the avatar.
avatarUrl String
Remote URL for setting the default avatar of the webhook.
channelId String
ID of the channel to create a webhook for.
githubUrl String
The GitHub-compatible webhook URL.
name String
Default name of the webhook.
slackUrl String
The Slack-compatible webhook URL.
token String
The webhook token.
url String
The webhook URL.
avatarDataUri string
Data URI of an image to set as the default avatar of the webhook.
avatarHash string
Hash of the avatar.
avatarUrl string
Remote URL for setting the default avatar of the webhook.
channelId string
ID of the channel to create a webhook for.
githubUrl string
The GitHub-compatible webhook URL.
name string
Default name of the webhook.
slackUrl string
The Slack-compatible webhook URL.
token string
The webhook token.
url string
The webhook URL.
avatar_data_uri str
Data URI of an image to set as the default avatar of the webhook.
avatar_hash str
Hash of the avatar.
avatar_url str
Remote URL for setting the default avatar of the webhook.
channel_id str
ID of the channel to create a webhook for.
github_url str
The GitHub-compatible webhook URL.
name str
Default name of the webhook.
slack_url str
The Slack-compatible webhook URL.
token str
The webhook token.
url str
The webhook URL.
avatarDataUri String
Data URI of an image to set as the default avatar of the webhook.
avatarHash String
Hash of the avatar.
avatarUrl String
Remote URL for setting the default avatar of the webhook.
channelId String
ID of the channel to create a webhook for.
githubUrl String
The GitHub-compatible webhook URL.
name String
Default name of the webhook.
slackUrl String
The Slack-compatible webhook URL.
token String
The webhook token.
url String
The webhook URL.

Import

$ pulumi import discord:index/webhook:Webhook example "<webhook id>"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
discord lucky3028/terraform-provider-discord
License
Notes
This Pulumi package is based on the discord Terraform Provider.