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

discord.getMember

Explore with Pulumi AI

discord 2.0.0 published on Friday, Mar 7, 2025 by lucky3028

Fetches a member’s information from a server.

Example Usage

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

const jake = discord.getMember({
    serverId: "81384788765712384",
    userId: "103559217914318848",
});
export const jakesUsernameAndDiscrim = Promise.all([jake, jake]).then(([jake, jake1]) => `${jake.username}#${jake1.discriminator}`);
Copy
import pulumi
import pulumi_discord as discord

jake = discord.get_member(server_id="81384788765712384",
    user_id="103559217914318848")
pulumi.export("jakesUsernameAndDiscrim", f"{jake.username}#{jake.discriminator}")
Copy
package main

import (
	"fmt"

	"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 {
		jake, err := discord.GetMember(ctx, &discord.GetMemberArgs{
			ServerId: "81384788765712384",
			UserId:   pulumi.StringRef("103559217914318848"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("jakesUsernameAndDiscrim", pulumi.Sprintf("%v#%v", jake.Username, jake.Discriminator))
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Discord = Pulumi.Discord;

return await Deployment.RunAsync(() => 
{
    var jake = Discord.GetMember.Invoke(new()
    {
        ServerId = "81384788765712384",
        UserId = "103559217914318848",
    });

    return new Dictionary<string, object?>
    {
        ["jakesUsernameAndDiscrim"] = Output.Tuple(jake, jake).Apply(values =>
        {
            var jake = values.Item1;
            var jake1 = values.Item2;
            return $"{jake.Apply(getMemberResult => getMemberResult.Username)}#{jake1.Discriminator}";
        }),
    };
});
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.GetMemberArgs;
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 jake = DiscordFunctions.getMember(GetMemberArgs.builder()
            .serverId("81384788765712384")
            .userId("103559217914318848")
            .build());

        ctx.export("jakesUsernameAndDiscrim", String.format("%s#%s", jake.applyValue(getMemberResult -> getMemberResult.username()),jake.applyValue(getMemberResult -> getMemberResult.discriminator())));
    }
}
Copy
variables:
  jake:
    fn::invoke:
      function: discord:getMember
      arguments:
        serverId: '81384788765712384'
        userId: '103559217914318848'
outputs:
  jakesUsernameAndDiscrim: ${jake.username}#${jake.discriminator}
Copy

Using getMember

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 getMember(args: GetMemberArgs, opts?: InvokeOptions): Promise<GetMemberResult>
function getMemberOutput(args: GetMemberOutputArgs, opts?: InvokeOptions): Output<GetMemberResult>
Copy
def get_member(discriminator: Optional[str] = None,
               server_id: Optional[str] = None,
               user_id: Optional[str] = None,
               username: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetMemberResult
def get_member_output(discriminator: Optional[pulumi.Input[str]] = None,
               server_id: Optional[pulumi.Input[str]] = None,
               user_id: Optional[pulumi.Input[str]] = None,
               username: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetMemberResult]
Copy
func GetMember(ctx *Context, args *GetMemberArgs, opts ...InvokeOption) (*GetMemberResult, error)
func GetMemberOutput(ctx *Context, args *GetMemberOutputArgs, opts ...InvokeOption) GetMemberResultOutput
Copy

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

public static class GetMember 
{
    public static Task<GetMemberResult> InvokeAsync(GetMemberArgs args, InvokeOptions? opts = null)
    public static Output<GetMemberResult> Invoke(GetMemberInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetMemberResult> getMember(GetMemberArgs args, InvokeOptions options)
public static Output<GetMemberResult> getMember(GetMemberArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: discord:index/getMember:getMember
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ServerId This property is required. string
The server ID to search for the user in.
Discriminator string
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

UserId string
The user ID to search for. Required if not searching by username / discriminator.
Username string
The username to search for.
ServerId This property is required. string
The server ID to search for the user in.
Discriminator string
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

UserId string
The user ID to search for. Required if not searching by username / discriminator.
Username string
The username to search for.
serverId This property is required. String
The server ID to search for the user in.
discriminator String
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

userId String
The user ID to search for. Required if not searching by username / discriminator.
username String
The username to search for.
serverId This property is required. string
The server ID to search for the user in.
discriminator string
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

userId string
The user ID to search for. Required if not searching by username / discriminator.
username string
The username to search for.
server_id This property is required. str
The server ID to search for the user in.
discriminator str
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

user_id str
The user ID to search for. Required if not searching by username / discriminator.
username str
The username to search for.
serverId This property is required. String
The server ID to search for the user in.
discriminator String
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

userId String
The user ID to search for. Required if not searching by username / discriminator.
username String
The username to search for.

getMember Result

The following output properties are available:

Avatar string
The avatar hash of the user.
Id string
The user's ID.
InServer bool
Whether the user is in the server.
JoinedAt string
The time at which the user joined.
Nick string
The current nickname of the user.
PremiumSince string
The time at which the user became premium.
Roles List<string>
IDs of the roles that the user has.
ServerId string
The server ID to search for the user in.
Discriminator string
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

UserId string
The user ID to search for. Required if not searching by username / discriminator.
Username string
The username to search for.
Avatar string
The avatar hash of the user.
Id string
The user's ID.
InServer bool
Whether the user is in the server.
JoinedAt string
The time at which the user joined.
Nick string
The current nickname of the user.
PremiumSince string
The time at which the user became premium.
Roles []string
IDs of the roles that the user has.
ServerId string
The server ID to search for the user in.
Discriminator string
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

UserId string
The user ID to search for. Required if not searching by username / discriminator.
Username string
The username to search for.
avatar String
The avatar hash of the user.
id String
The user's ID.
inServer Boolean
Whether the user is in the server.
joinedAt String
The time at which the user joined.
nick String
The current nickname of the user.
premiumSince String
The time at which the user became premium.
roles List<String>
IDs of the roles that the user has.
serverId String
The server ID to search for the user in.
discriminator String
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

userId String
The user ID to search for. Required if not searching by username / discriminator.
username String
The username to search for.
avatar string
The avatar hash of the user.
id string
The user's ID.
inServer boolean
Whether the user is in the server.
joinedAt string
The time at which the user joined.
nick string
The current nickname of the user.
premiumSince string
The time at which the user became premium.
roles string[]
IDs of the roles that the user has.
serverId string
The server ID to search for the user in.
discriminator string
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

userId string
The user ID to search for. Required if not searching by username / discriminator.
username string
The username to search for.
avatar str
The avatar hash of the user.
id str
The user's ID.
in_server bool
Whether the user is in the server.
joined_at str
The time at which the user joined.
nick str
The current nickname of the user.
premium_since str
The time at which the user became premium.
roles Sequence[str]
IDs of the roles that the user has.
server_id str
The server ID to search for the user in.
discriminator str
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

user_id str
The user ID to search for. Required if not searching by username / discriminator.
username str
The username to search for.
avatar String
The avatar hash of the user.
id String
The user's ID.
inServer Boolean
Whether the user is in the server.
joinedAt String
The time at which the user joined.
nick String
The current nickname of the user.
premiumSince String
The time at which the user became premium.
roles List<String>
IDs of the roles that the user has.
serverId String
The server ID to search for the user in.
discriminator String
The discriminator to search for. username is required when using this.

Deprecated: Deprecated

userId String
The user ID to search for. Required if not searching by username / discriminator.
username String
The username to search for.

Package Details

Repository
discord lucky3028/terraform-provider-discord
License
Notes
This Pulumi package is based on the discord Terraform Provider.
discord 2.0.0 published on Friday, Mar 7, 2025 by lucky3028