GuildManager class

A manager for Guilds.

Inheritance

Constructors

GuildManager(CacheConfig<Guild> config, NyxxRest client)
Create a new GuildManager.

Properties

cache Cache<Guild>
The cache for this manager.
finalinherited
client NyxxRest
The client this manager belongs to.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bulkBan(Snowflake id, List<Snowflake> userIds, {Duration? deleteMessages, String? auditLogReason}) Future<BulkBanResponse>
Ban up to 200 users from a guild, and optionally delete previous messages sent by the banned users.
create(covariant GuildBuilder builder) Future<Guild>
Create a new instance of the type of this manager.
override
createBan(Snowflake id, Snowflake userId, {Duration? deleteMessages, String? auditLogReason}) Future<void>
Create a ban in a guild.
createGuildChannel<T extends GuildChannel>(Snowflake id, GuildChannelBuilder<T> builder, {String? auditLogReason}) Future<T>
Create a channel in a guild.
createGuildFromTemplate(String code, {required String name, ImageBuilder? icon}) Future<Guild>
Create a guild from a guild template.
createGuildTemplate(Snowflake id, GuildTemplateBuilder builder) Future<GuildTemplate>
Create a guild template.
delete(Snowflake id) Future<void>
Delete the item with the given id from the API.
override
deleteBan(Snowflake id, Snowflake userId, {String? auditLogReason}) Future<void>
Delete a ban in a guild.
deleteGuildTemplate(Snowflake id, String code) Future<GuildTemplate>
Delete a guild template.
fetch(Snowflake id, {bool? withCounts}) Future<Guild>
Fetch the item with the given id from the API.
override
fetchBan(Snowflake id, Snowflake userId) Future<Ban>
Fetch a ban in a guild.
fetchGuildChannels(Snowflake id) Future<List<GuildChannel>>
Fetch the channels in a guild.
fetchGuildPreview(Snowflake id) Future<GuildPreview>
Fetch a guild's preview.
fetchGuildTemplate(String code) Future<GuildTemplate>
Fetch a guild template by code.
fetchGuildWidget(Snowflake id) Future<GuildWidget>
Fetch a guild's widget.
fetchGuildWidgetImage(Snowflake id, {WidgetImageStyle? style}) Future<Uint8List>
Fetch the image for a guild's widget.
fetchOnboarding(Snowflake id) Future<Onboarding>
Fetch a guild's onboarding.
fetchPruneCount(Snowflake id, {int? days, List<Snowflake>? roleIds}) Future<int>
Fetch the prune count in a guild.
fetchVanityCode(Snowflake id) Future<String?>
Fetch a guild's vanity invite code.
fetchWelcomeScreen(Snowflake id) Future<WelcomeScreen>
Fetch a guild's welcome screen.
fetchWidgetSettings(Snowflake id) Future<WidgetSettings>
Fetch a guild's widget settings.
get(Snowflake id) Future<Guild>
Get an item by its id from the cache if it exists, else fetch it from the API.
inherited
listActiveThreads(Snowflake id) Future<ThreadList>
List the active threads in a guild.
listBans(Snowflake id, {int? limit, Snowflake? after, Snowflake? before}) Future<List<Ban>>
List the bans in a guild.
listGuildTemplates(Snowflake id) Future<List<GuildTemplate>>
List the templates in a guild.
listInvites(Snowflake id) Future<List<Invite>>
List the invites in a guild.
listVoiceRegions(Snowflake id) Future<List<VoiceRegion>>
List the voice regions in a guild.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(Map<String, Object?> raw) Guild
Parse the raw data received from the API into an instance of the type of this manager.
override
parseBan(Map<String, Object?> raw) Ban
Parse a Ban from raw.
parseBulkBanResponse(Map<String, Object?> raw) BulkBanResponse
Parse a BulkBanResponse from raw.
parseGuildFeature(String raw) Flag<GuildFeatures>
Parse a Flag
parseGuildFeatures(List<Object?> raw) GuildFeatures
Parse an GuildFeatures from raw.
parseGuildPreview(Map<String, Object?> raw) GuildPreview
Parse a GuildPreview from raw.
parseGuildTemplate(Map<String, Object?> raw) GuildTemplate
Parse a GuildTemplate from raw.
parseGuildWidget(Map<String, Object?> raw) GuildWidget
Parse a GuildWidget from raw.
parseOnboarding(Map<String, Object?> raw) Onboarding
Parse an Onboarding from raw.
parseOnboardingPrompt(Map<String, Object?> raw, {Snowflake? guildId}) OnboardingPrompt
Parse an OnboardingPrompt from raw.
parseOnboardingPromptOption(Map<String, Object?> raw, {Snowflake? guildId}) OnboardingPromptOption
Parse an OnboardingPromptOption from raw.
parseUserGuild(Map<String, Object?> raw) UserGuild
Parse UserGuild from raw.
parseWelcomeScreen(Map<String, Object?> raw) WelcomeScreen
Parse a WelcomeScreen from raw.
parseWelcomeScreenChannel(Map<String, Object?> raw) WelcomeScreenChannel
Parse a WelcomeScreenChannel from raw.
parseWidgetSettings(Map<String, Object?> raw) WidgetSettings
Parse a WidgetSettings from raw.
startGuildPrune(Snowflake id, {int? days, bool? computeCount, List<Snowflake>? roleIds, String? auditLogReason}) Future<int?>
Start a prune in a guild.
syncGuildTemplate(Snowflake id, String code) Future<GuildTemplate>
Sync a guild template to the source guild.
toString() String
A string representation of this object.
inherited
update(Snowflake id, covariant GuildUpdateBuilder builder, {String? auditLogReason}) Future<Guild>
Update the item with the given id in the API.
override
updateChannelPositions(Snowflake id, List<ChannelPositionBuilder> positions) Future<void>
Update the positions of channels in a guild.
updateCurrentUserVoiceState(Snowflake id, CurrentUserVoiceStateUpdateBuilder builder) Future<void>
Update the current user's voice state in a guild.
updateGuildTemplate(Snowflake id, String code, GuildTemplateUpdateBuilder builder) Future<GuildTemplate>
Update a guild template.
updateMfaLevel(Snowflake id, MfaLevel level, {String? auditLogReason}) Future<MfaLevel>
Update a guild's MFA level.
updateVoiceState(Snowflake id, Snowflake userId, VoiceStateUpdateBuilder builder) Future<void>
Update a member's voice state in a guild.
updateWelcomeScreen(Snowflake id, WelcomeScreenUpdateBuilder builder, {String? auditLogReason}) Future<WelcomeScreen>
Update a guild's welcome screen.
updateWidgetSettings(Snowflake id, WidgetSettingsUpdateBuilder builder, {String? auditLogReason}) Future<WidgetSettings>
Update a guild's widget settings.

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Snowflake id) PartialGuild
Return a partial instance of the entity with ID id containing no data.
override

Static Methods

serializeGuildFeature(Flag<GuildFeatures> source) String
Serialize source to a String.
serializeGuildFeatures(Flags<GuildFeatures> source) List<String>
Serialize source to a List