grom/invite
Types
pub type Create {
Create(
max_age: option.Option(duration.Duration),
max_uses: option.Option(Int),
is_temporary: option.Option(Bool),
target_type: option.Option(TargetType),
target_user_id: option.Option(String),
target_application_id: option.Option(String),
)
}
Constructors
-
Create( max_age: option.Option(duration.Duration), max_uses: option.Option(Int), is_temporary: option.Option(Bool), target_type: option.Option(TargetType), target_user_id: option.Option(String), target_application_id: option.Option(String), )
pub type Invite {
InviteWithoutMetadata(WithoutMetadata)
InviteWithMetadata(WithMetadata)
}
Constructors
-
InviteWithoutMetadata(WithoutMetadata) -
InviteWithMetadata(WithMetadata)
pub type TargetType {
Stream
EmbeddedApplication
}
Constructors
-
Stream -
EmbeddedApplication
pub type WithMetadata {
WithMetadata(
type_: Type,
code: String,
guild: option.Option(guild.Guild),
channel: option.Option(channel.Channel),
inviter: option.Option(user.User),
target_type: option.Option(TargetType),
target_user: option.Option(user.User),
target_application: option.Option(application.Application),
approximate_presence_count: option.Option(Int),
approximate_member_count: option.Option(Int),
expires_at: option.Option(timestamp.Timestamp),
uses: Int,
max_uses: Int,
max_age: duration.Duration,
is_temporary: Bool,
created_at: timestamp.Timestamp,
)
}
Constructors
-
WithMetadata( type_: Type, code: String, guild: option.Option(guild.Guild), channel: option.Option(channel.Channel), inviter: option.Option(user.User), target_type: option.Option(TargetType), target_user: option.Option(user.User), target_application: option.Option(application.Application), approximate_presence_count: option.Option(Int), approximate_member_count: option.Option(Int), expires_at: option.Option(timestamp.Timestamp), uses: Int, max_uses: Int, max_age: duration.Duration, is_temporary: Bool, created_at: timestamp.Timestamp, )
pub type WithoutMetadata {
WithoutMetadata(
type_: Type,
code: String,
guild: option.Option(guild.Guild),
channel: option.Option(channel.Channel),
inviter: option.Option(user.User),
target_type: option.Option(TargetType),
target_user: option.Option(user.User),
target_application: option.Option(application.Application),
approximate_presence_count: option.Option(Int),
approximate_member_count: option.Option(Int),
expires_at: option.Option(timestamp.Timestamp),
)
}
Constructors
-
WithoutMetadata( type_: Type, code: String, guild: option.Option(guild.Guild), channel: option.Option(channel.Channel), inviter: option.Option(user.User), target_type: option.Option(TargetType), target_user: option.Option(user.User), target_application: option.Option(application.Application), approximate_presence_count: option.Option(Int), approximate_member_count: option.Option(Int), expires_at: option.Option(timestamp.Timestamp), )
Values
pub fn create(
client: grom.Client,
for channel_id: String,
with create: Create,
reason reason: option.Option(String),
) -> Result(WithoutMetadata, grom.Error)
pub fn delete(
client: grom.Client,
code invite_code: String,
because reason: option.Option(String),
) -> Result(Nil, grom.Error)
pub fn get(
client: grom.Client,
code invite_code: String,
include_counts with_counts: Bool,
scheduled_event_id guild_scheduled_event_id: option.Option(
String,
),
) -> Result(Invite, grom.Error)
pub fn get_all_for_channel(
client: grom.Client,
with_id channel_id: String,
) -> Result(List(WithMetadata), grom.Error)
pub fn get_all_for_guild(
client: grom.Client,
with_id guild_id: String,
) -> Result(List(Invite), grom.Error)
pub fn new_create() -> Create