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

discord.NewsChannel

Explore with Pulumi AI

A resource to create a news channel.

Example Usage

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

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

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

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

Create NewsChannel Resource

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

Constructor syntax

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

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

NewsChannel 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 NewsChannel 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.
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.
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.
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.
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.
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.
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 NewsChannel 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 NewsChannel Resource

Get an existing NewsChannel 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?: NewsChannelState, opts?: CustomResourceOptions): NewsChannel
@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,
        position: Optional[float] = None,
        server_id: Optional[str] = None,
        sync_perms_with_category: Optional[bool] = None,
        topic: Optional[str] = None,
        type: Optional[str] = None) -> NewsChannel
func GetNewsChannel(ctx *Context, name string, id IDInput, state *NewsChannelState, opts ...ResourceOption) (*NewsChannel, error)
public static NewsChannel Get(string name, Input<string> id, NewsChannelState? state, CustomResourceOptions? opts = null)
public static NewsChannel get(String name, Output<String> id, NewsChannelState state, CustomResourceOptions options)
resources:  _:    type: discord:NewsChannel    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.
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.
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.
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.
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.
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.
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/newsChannel:NewsChannel 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.