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

discord.TextChannel

Explore with Pulumi AI

A resource to create a text channel.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as discord from "@pulumi/discord";

const general = new discord.TextChannel("general", {
    serverId: _var.server_id,
    position: 0,
});
Copy
import pulumi
import pulumi_discord as discord

general = discord.TextChannel("general",
    server_id=var["server_id"],
    position=0)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/discord/v2/discord"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := discord.NewTextChannel(ctx, "general", &discord.TextChannelArgs{
			ServerId: pulumi.Any(_var.Server_id),
			Position: pulumi.Float64(0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Discord = Pulumi.Discord;

return await Deployment.RunAsync(() => 
{
    var general = new Discord.TextChannel("general", new()
    {
        ServerId = @var.Server_id,
        Position = 0,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.discord.TextChannel;
import com.pulumi.discord.TextChannelArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var general = new TextChannel("general", TextChannelArgs.builder()
            .serverId(var_.server_id())
            .position(0)
            .build());

    }
}
Copy
resources:
  general:
    type: discord:TextChannel
    properties:
      serverId: ${var.server_id}
      position: 0
Copy

Create TextChannel Resource

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

Constructor syntax

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

@overload
def TextChannel(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                server_id: Optional[str] = None,
                category: Optional[str] = None,
                name: Optional[str] = None,
                nsfw: Optional[bool] = None,
                position: Optional[float] = None,
                sync_perms_with_category: Optional[bool] = None,
                topic: Optional[str] = None,
                type: Optional[str] = None)
func NewTextChannel(ctx *Context, name string, args TextChannelArgs, opts ...ResourceOption) (*TextChannel, error)
public TextChannel(string name, TextChannelArgs args, CustomResourceOptions? opts = null)
public TextChannel(String name, TextChannelArgs args)
public TextChannel(String name, TextChannelArgs args, CustomResourceOptions options)
type: discord:TextChannel
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. TextChannelArgs
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. TextChannelArgs
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. TextChannelArgs
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. TextChannelArgs
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. TextChannelArgs
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 textChannelResource = new Discord.TextChannel("textChannelResource", new()
{
    ServerId = "string",
    Category = "string",
    Name = "string",
    Nsfw = false,
    Position = 0,
    SyncPermsWithCategory = false,
    Topic = "string",
    Type = "string",
});
Copy
example, err := discord.NewTextChannel(ctx, "textChannelResource", &discord.TextChannelArgs{
	ServerId:              pulumi.String("string"),
	Category:              pulumi.String("string"),
	Name:                  pulumi.String("string"),
	Nsfw:                  pulumi.Bool(false),
	Position:              pulumi.Float64(0),
	SyncPermsWithCategory: pulumi.Bool(false),
	Topic:                 pulumi.String("string"),
	Type:                  pulumi.String("string"),
})
Copy
var textChannelResource = new TextChannel("textChannelResource", TextChannelArgs.builder()
    .serverId("string")
    .category("string")
    .name("string")
    .nsfw(false)
    .position(0)
    .syncPermsWithCategory(false)
    .topic("string")
    .type("string")
    .build());
Copy
text_channel_resource = discord.TextChannel("textChannelResource",
    server_id="string",
    category="string",
    name="string",
    nsfw=False,
    position=0,
    sync_perms_with_category=False,
    topic="string",
    type="string")
Copy
const textChannelResource = new discord.TextChannel("textChannelResource", {
    serverId: "string",
    category: "string",
    name: "string",
    nsfw: false,
    position: 0,
    syncPermsWithCategory: false,
    topic: "string",
    type: "string",
});
Copy
type: discord:TextChannel
properties:
    category: string
    name: string
    nsfw: false
    position: 0
    serverId: string
    syncPermsWithCategory: false
    topic: string
    type: string
Copy

TextChannel 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 TextChannel resource accepts the following input properties:

ServerId This property is required. string
ID of server this channel is in.
Category string
ID of category to place this channel in.
Name string
Name of the channel.
Nsfw bool
Whether the channel is NSFW.
Position double
Position of the channel, 0-indexed.
SyncPermsWithCategory bool
Whether channel permissions should be synced with the category this channel is in.
Topic string
Topic of the channel.
Type string
The type of the channel. This is only for internal use and should never be provided.
ServerId This property is required. string
ID of server this channel is in.
Category string
ID of category to place this channel in.
Name string
Name of the channel.
Nsfw bool
Whether the channel is NSFW.
Position float64
Position of the channel, 0-indexed.
SyncPermsWithCategory bool
Whether channel permissions should be synced with the category this channel is in.
Topic string
Topic of the channel.
Type string
The type of the channel. This is only for internal use and should never be provided.
serverId This property is required. String
ID of server this channel is in.
category String
ID of category to place this channel in.
name String
Name of the channel.
nsfw Boolean
Whether the channel is NSFW.
position Double
Position of the channel, 0-indexed.
syncPermsWithCategory Boolean
Whether channel permissions should be synced with the category this channel is in.
topic String
Topic of the channel.
type String
The type of the channel. This is only for internal use and should never be provided.
serverId This property is required. string
ID of server this channel is in.
category string
ID of category to place this channel in.
name string
Name of the channel.
nsfw boolean
Whether the channel is NSFW.
position number
Position of the channel, 0-indexed.
syncPermsWithCategory boolean
Whether channel permissions should be synced with the category this channel is in.
topic string
Topic of the channel.
type string
The type of the channel. This is only for internal use and should never be provided.
server_id This property is required. str
ID of server this channel is in.
category str
ID of category to place this channel in.
name str
Name of the channel.
nsfw bool
Whether the channel is NSFW.
position float
Position of the channel, 0-indexed.
sync_perms_with_category bool
Whether channel permissions should be synced with the category this channel is in.
topic str
Topic of the channel.
type str
The type of the channel. This is only for internal use and should never be provided.
serverId This property is required. String
ID of server this channel is in.
category String
ID of category to place this channel in.
name String
Name of the channel.
nsfw Boolean
Whether the channel is NSFW.
position Number
Position of the channel, 0-indexed.
syncPermsWithCategory Boolean
Whether channel permissions should be synced with the category this channel is in.
topic String
Topic of the channel.
type String
The type of the channel. This is only for internal use and should never be provided.

Outputs

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

ChannelId string
The ID of the channel.
Id string
The provider-assigned unique ID for this managed resource.
ChannelId string
The ID of the channel.
Id string
The provider-assigned unique ID for this managed resource.
channelId String
The ID of the channel.
id String
The provider-assigned unique ID for this managed resource.
channelId string
The ID of the channel.
id string
The provider-assigned unique ID for this managed resource.
channel_id str
The ID of the channel.
id str
The provider-assigned unique ID for this managed resource.
channelId String
The ID of the channel.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TextChannel Resource

Get an existing TextChannel 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?: TextChannelState, opts?: CustomResourceOptions): TextChannel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        category: Optional[str] = None,
        channel_id: Optional[str] = None,
        name: Optional[str] = None,
        nsfw: Optional[bool] = None,
        position: Optional[float] = None,
        server_id: Optional[str] = None,
        sync_perms_with_category: Optional[bool] = None,
        topic: Optional[str] = None,
        type: Optional[str] = None) -> TextChannel
func GetTextChannel(ctx *Context, name string, id IDInput, state *TextChannelState, opts ...ResourceOption) (*TextChannel, error)
public static TextChannel Get(string name, Input<string> id, TextChannelState? state, CustomResourceOptions? opts = null)
public static TextChannel get(String name, Output<String> id, TextChannelState state, CustomResourceOptions options)
resources:  _:    type: discord:TextChannel    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:
Category string
ID of category to place this channel in.
ChannelId string
The ID of the channel.
Name string
Name of the channel.
Nsfw bool
Whether the channel is NSFW.
Position double
Position of the channel, 0-indexed.
ServerId string
ID of server this channel is in.
SyncPermsWithCategory bool
Whether channel permissions should be synced with the category this channel is in.
Topic string
Topic of the channel.
Type string
The type of the channel. This is only for internal use and should never be provided.
Category string
ID of category to place this channel in.
ChannelId string
The ID of the channel.
Name string
Name of the channel.
Nsfw bool
Whether the channel is NSFW.
Position float64
Position of the channel, 0-indexed.
ServerId string
ID of server this channel is in.
SyncPermsWithCategory bool
Whether channel permissions should be synced with the category this channel is in.
Topic string
Topic of the channel.
Type string
The type of the channel. This is only for internal use and should never be provided.
category String
ID of category to place this channel in.
channelId String
The ID of the channel.
name String
Name of the channel.
nsfw Boolean
Whether the channel is NSFW.
position Double
Position of the channel, 0-indexed.
serverId String
ID of server this channel is in.
syncPermsWithCategory Boolean
Whether channel permissions should be synced with the category this channel is in.
topic String
Topic of the channel.
type String
The type of the channel. This is only for internal use and should never be provided.
category string
ID of category to place this channel in.
channelId string
The ID of the channel.
name string
Name of the channel.
nsfw boolean
Whether the channel is NSFW.
position number
Position of the channel, 0-indexed.
serverId string
ID of server this channel is in.
syncPermsWithCategory boolean
Whether channel permissions should be synced with the category this channel is in.
topic string
Topic of the channel.
type string
The type of the channel. This is only for internal use and should never be provided.
category str
ID of category to place this channel in.
channel_id str
The ID of the channel.
name str
Name of the channel.
nsfw bool
Whether the channel is NSFW.
position float
Position of the channel, 0-indexed.
server_id str
ID of server this channel is in.
sync_perms_with_category bool
Whether channel permissions should be synced with the category this channel is in.
topic str
Topic of the channel.
type str
The type of the channel. This is only for internal use and should never be provided.
category String
ID of category to place this channel in.
channelId String
The ID of the channel.
name String
Name of the channel.
nsfw Boolean
Whether the channel is NSFW.
position Number
Position of the channel, 0-indexed.
serverId String
ID of server this channel is in.
syncPermsWithCategory Boolean
Whether channel permissions should be synced with the category this channel is in.
topic String
Topic of the channel.
type String
The type of the channel. This is only for internal use and should never be provided.

Import

$ pulumi import discord:index/textChannel:TextChannel example "<channel 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.