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

discord.getServer

Explore with Pulumi AI

Fetches a server’s information.

Example Usage

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

const discordApi = discord.getServer({
    serverId: "81384788765712384",
});
export const discordApiRegion = discordApi.then(discordApi => discordApi.region);
Copy
import pulumi
import pulumi_discord as discord

discord_api = discord.get_server(server_id="81384788765712384")
pulumi.export("discordApiRegion", discord_api.region)
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 {
		discordApi, err := discord.LookupServer(ctx, &discord.LookupServerArgs{
			ServerId: pulumi.StringRef("81384788765712384"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("discordApiRegion", discordApi.Region)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Discord = Pulumi.Discord;

return await Deployment.RunAsync(() => 
{
    var discordApi = Discord.GetServer.Invoke(new()
    {
        ServerId = "81384788765712384",
    });

    return new Dictionary<string, object?>
    {
        ["discordApiRegion"] = discordApi.Apply(getServerResult => getServerResult.Region),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.discord.DiscordFunctions;
import com.pulumi.discord.inputs.GetServerArgs;
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) {
        final var discordApi = DiscordFunctions.getServer(GetServerArgs.builder()
            .serverId("81384788765712384")
            .build());

        ctx.export("discordApiRegion", discordApi.applyValue(getServerResult -> getServerResult.region()));
    }
}
Copy
variables:
  discordApi:
    fn::invoke:
      function: discord:getServer
      arguments:
        serverId: '81384788765712384'
outputs:
  discordApiRegion: ${discordApi.region}
Copy

Using getServer

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getServer(args: GetServerArgs, opts?: InvokeOptions): Promise<GetServerResult>
function getServerOutput(args: GetServerOutputArgs, opts?: InvokeOptions): Output<GetServerResult>
Copy
def get_server(name: Optional[str] = None,
               server_id: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetServerResult
def get_server_output(name: Optional[pulumi.Input[str]] = None,
               server_id: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetServerResult]
Copy
func LookupServer(ctx *Context, args *LookupServerArgs, opts ...InvokeOption) (*LookupServerResult, error)
func LookupServerOutput(ctx *Context, args *LookupServerOutputArgs, opts ...InvokeOption) LookupServerResultOutput
Copy

> Note: This function is named LookupServer in the Go SDK.

public static class GetServer 
{
    public static Task<GetServerResult> InvokeAsync(GetServerArgs args, InvokeOptions? opts = null)
    public static Output<GetServerResult> Invoke(GetServerInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServerResult> getServer(GetServerArgs args, InvokeOptions options)
public static Output<GetServerResult> getServer(GetServerArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: discord:index/getServer:getServer
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name string
The server name to search for.
ServerId string
The server ID to search for.
Name string
The server name to search for.
ServerId string
The server ID to search for.
name String
The server name to search for.
serverId String
The server ID to search for.
name string
The server name to search for.
serverId string
The server ID to search for.
name str
The server name to search for.
server_id str
The server ID to search for.
name String
The server name to search for.
serverId String
The server ID to search for.

getServer Result

The following output properties are available:

AfkChannelId double
The AFK channel ID.
AfkTimeout double
The AFK timeout of the server.
DefaultMessageNotifications double
The default message notification level of the server.
ExplicitContentFilter double
The explicit content filter level of the server.
IconHash string
The hash of the server icon.
Id string
The ID of the server.
OwnerId string
The ID of the owner.
Region string
The region of the server.
Roles List<GetServerRole>
List of roles in the server.
SplashHash string
The hash of the server splash.
VerificationLevel double
The required verification level of the server.
Name string
The server name to search for.
ServerId string
The server ID to search for.
AfkChannelId float64
The AFK channel ID.
AfkTimeout float64
The AFK timeout of the server.
DefaultMessageNotifications float64
The default message notification level of the server.
ExplicitContentFilter float64
The explicit content filter level of the server.
IconHash string
The hash of the server icon.
Id string
The ID of the server.
OwnerId string
The ID of the owner.
Region string
The region of the server.
Roles []GetServerRole
List of roles in the server.
SplashHash string
The hash of the server splash.
VerificationLevel float64
The required verification level of the server.
Name string
The server name to search for.
ServerId string
The server ID to search for.
afkChannelId Double
The AFK channel ID.
afkTimeout Double
The AFK timeout of the server.
defaultMessageNotifications Double
The default message notification level of the server.
explicitContentFilter Double
The explicit content filter level of the server.
iconHash String
The hash of the server icon.
id String
The ID of the server.
ownerId String
The ID of the owner.
region String
The region of the server.
roles List<GetServerRole>
List of roles in the server.
splashHash String
The hash of the server splash.
verificationLevel Double
The required verification level of the server.
name String
The server name to search for.
serverId String
The server ID to search for.
afkChannelId number
The AFK channel ID.
afkTimeout number
The AFK timeout of the server.
defaultMessageNotifications number
The default message notification level of the server.
explicitContentFilter number
The explicit content filter level of the server.
iconHash string
The hash of the server icon.
id string
The ID of the server.
ownerId string
The ID of the owner.
region string
The region of the server.
roles GetServerRole[]
List of roles in the server.
splashHash string
The hash of the server splash.
verificationLevel number
The required verification level of the server.
name string
The server name to search for.
serverId string
The server ID to search for.
afk_channel_id float
The AFK channel ID.
afk_timeout float
The AFK timeout of the server.
default_message_notifications float
The default message notification level of the server.
explicit_content_filter float
The explicit content filter level of the server.
icon_hash str
The hash of the server icon.
id str
The ID of the server.
owner_id str
The ID of the owner.
region str
The region of the server.
roles Sequence[GetServerRole]
List of roles in the server.
splash_hash str
The hash of the server splash.
verification_level float
The required verification level of the server.
name str
The server name to search for.
server_id str
The server ID to search for.
afkChannelId Number
The AFK channel ID.
afkTimeout Number
The AFK timeout of the server.
defaultMessageNotifications Number
The default message notification level of the server.
explicitContentFilter Number
The explicit content filter level of the server.
iconHash String
The hash of the server icon.
id String
The ID of the server.
ownerId String
The ID of the owner.
region String
The region of the server.
roles List<Property Map>
List of roles in the server.
splashHash String
The hash of the server splash.
verificationLevel Number
The required verification level of the server.
name String
The server name to search for.
serverId String
The server ID to search for.

Supporting Types

GetServerRole

Color This property is required. double
Hoist This property is required. bool
Id This property is required. string
Managed This property is required. bool
Mentionable This property is required. bool
Name This property is required. string
Permissions This property is required. double
Position This property is required. double
Color This property is required. float64
Hoist This property is required. bool
Id This property is required. string
Managed This property is required. bool
Mentionable This property is required. bool
Name This property is required. string
Permissions This property is required. float64
Position This property is required. float64
color This property is required. Double
hoist This property is required. Boolean
id This property is required. String
managed This property is required. Boolean
mentionable This property is required. Boolean
name This property is required. String
permissions This property is required. Double
position This property is required. Double
color This property is required. number
hoist This property is required. boolean
id This property is required. string
managed This property is required. boolean
mentionable This property is required. boolean
name This property is required. string
permissions This property is required. number
position This property is required. number
color This property is required. float
hoist This property is required. bool
id This property is required. str
managed This property is required. bool
mentionable This property is required. bool
name This property is required. str
permissions This property is required. float
position This property is required. float
color This property is required. Number
hoist This property is required. Boolean
id This property is required. String
managed This property is required. Boolean
mentionable This property is required. Boolean
name This property is required. String
permissions This property is required. Number
position This property is required. Number

Package Details

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