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

discord.VoiceChannel

Explore with Pulumi AI

A resource to create a voice channel.

Example Usage

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

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

general = discord.VoiceChannel("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.NewVoiceChannel(ctx, "general", &discord.VoiceChannelArgs{
			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.VoiceChannel("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.VoiceChannel;
import com.pulumi.discord.VoiceChannelArgs;
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 VoiceChannel("general", VoiceChannelArgs.builder()
            .serverId(var_.server_id())
            .position(0)
            .build());

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

Create VoiceChannel Resource

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

Constructor syntax

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

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

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

ServerId This property is required. string
ID of server this channel is in.
Bitrate double
Bitrate of the channel.
Category string
ID of category to place this channel in.
Name string
Name of the channel.
Position double
Position of the channel, 0-indexed.
SyncPermsWithCategory bool
Whether channel permissions should be synced with the category this channel is in.
Type string
The type of the channel. This is only for internal use and should never be provided.
UserLimit double
User limit of the channel.
ServerId This property is required. string
ID of server this channel is in.
Bitrate float64
Bitrate of the channel.
Category string
ID of category to place this channel in.
Name string
Name of the channel.
Position float64
Position of the channel, 0-indexed.
SyncPermsWithCategory bool
Whether channel permissions should be synced with the category this channel is in.
Type string
The type of the channel. This is only for internal use and should never be provided.
UserLimit float64
User limit of the channel.
serverId This property is required. String
ID of server this channel is in.
bitrate Double
Bitrate of the channel.
category String
ID of category to place this channel in.
name String
Name of the channel.
position Double
Position of the channel, 0-indexed.
syncPermsWithCategory Boolean
Whether channel permissions should be synced with the category this channel is in.
type String
The type of the channel. This is only for internal use and should never be provided.
userLimit Double
User limit of the channel.
serverId This property is required. string
ID of server this channel is in.
bitrate number
Bitrate of the channel.
category string
ID of category to place this channel in.
name string
Name of the channel.
position number
Position of the channel, 0-indexed.
syncPermsWithCategory boolean
Whether channel permissions should be synced with the category this channel is in.
type string
The type of the channel. This is only for internal use and should never be provided.
userLimit number
User limit of the channel.
server_id This property is required. str
ID of server this channel is in.
bitrate float
Bitrate of the channel.
category str
ID of category to place this channel in.
name str
Name of the channel.
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.
type str
The type of the channel. This is only for internal use and should never be provided.
user_limit float
User limit of the channel.
serverId This property is required. String
ID of server this channel is in.
bitrate Number
Bitrate of the channel.
category String
ID of category to place this channel in.
name String
Name of the channel.
position Number
Position of the channel, 0-indexed.
syncPermsWithCategory Boolean
Whether channel permissions should be synced with the category this channel is in.
type String
The type of the channel. This is only for internal use and should never be provided.
userLimit Number
User limit of the channel.

Outputs

All input properties are implicitly available as output properties. Additionally, the VoiceChannel 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 VoiceChannel Resource

Get an existing VoiceChannel 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?: VoiceChannelState, opts?: CustomResourceOptions): VoiceChannel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bitrate: Optional[float] = None,
        category: Optional[str] = None,
        channel_id: Optional[str] = None,
        name: Optional[str] = None,
        position: Optional[float] = None,
        server_id: Optional[str] = None,
        sync_perms_with_category: Optional[bool] = None,
        type: Optional[str] = None,
        user_limit: Optional[float] = None) -> VoiceChannel
func GetVoiceChannel(ctx *Context, name string, id IDInput, state *VoiceChannelState, opts ...ResourceOption) (*VoiceChannel, error)
public static VoiceChannel Get(string name, Input<string> id, VoiceChannelState? state, CustomResourceOptions? opts = null)
public static VoiceChannel get(String name, Output<String> id, VoiceChannelState state, CustomResourceOptions options)
resources:  _:    type: discord:VoiceChannel    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:
Bitrate double
Bitrate of the channel.
Category string
ID of category to place this channel in.
ChannelId string
The ID of the channel.
Name string
Name of the channel.
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.
Type string
The type of the channel. This is only for internal use and should never be provided.
UserLimit double
User limit of the channel.
Bitrate float64
Bitrate of the channel.
Category string
ID of category to place this channel in.
ChannelId string
The ID of the channel.
Name string
Name of the channel.
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.
Type string
The type of the channel. This is only for internal use and should never be provided.
UserLimit float64
User limit of the channel.
bitrate Double
Bitrate of the channel.
category String
ID of category to place this channel in.
channelId String
The ID of the channel.
name String
Name of the channel.
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.
type String
The type of the channel. This is only for internal use and should never be provided.
userLimit Double
User limit of the channel.
bitrate number
Bitrate of the channel.
category string
ID of category to place this channel in.
channelId string
The ID of the channel.
name string
Name of the channel.
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.
type string
The type of the channel. This is only for internal use and should never be provided.
userLimit number
User limit of the channel.
bitrate float
Bitrate of the channel.
category str
ID of category to place this channel in.
channel_id str
The ID of the channel.
name str
Name of the channel.
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.
type str
The type of the channel. This is only for internal use and should never be provided.
user_limit float
User limit of the channel.
bitrate Number
Bitrate of the channel.
category String
ID of category to place this channel in.
channelId String
The ID of the channel.
name String
Name of the channel.
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.
type String
The type of the channel. This is only for internal use and should never be provided.
userLimit Number
User limit of the channel.

Import

$ pulumi import discord:index/voiceChannel:VoiceChannel 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.