nyxx library

Nyxx Discord API wrapper for Dart

Main library which contains all stuff needed to connect and interact with Discord API.

Classes

Activity
Presence is game or activity which user is playing/user participate. Can be game, eg. Dota 2, VS Code or activity like Listening to song on Spotify.
ActivityEmoji
Represent emoji within activity
ActivityParty
Represents party of game.
ActivityTimestamps
ActivityType
Represents type of presence activity
AllowedMentions
The allowed mention field allows for more granular control over mentions without various hacks to the message content. This will always validate against message content to avoid phantom pings (e.g. to ping everyone, you must still have @everyone in the message content), and check against user/bot permissions. [...]
AppTeam
AppTeamMember
Represent membership of user in AppTeam
AppTeamUser
Represent user in AppTeamMember context
Attachment
A message attachment.
AttachmentBuilder
Helper for sending attachment in messages. Allows to create attachment from path, File or bytes.
AuditLog
Whenever an admin action is performed on the API, an entry is added to the respective guild's audit log. [...]
AuditLogChange
Represents change made in guild with old and new value [...]
AuditLogEntry
Single entry of Audit Log [...]
AuditLogEntryType
Ban
Ban object. Has attached reason of ban and user who was banned.
BasicRequest
BasicRequest with json body
Builder
Provides abstraction for builders
Cache<T, S>
Generic interface for caching entities. Wraps Map interface and provides utilities for manipulating cache.
CacheGuildChannel
Guild channel which does have access to cache.
CachelessGuildChannel
Guild channel which does not have access to cache.
CachelessMember
Stateless IMember instance. Does not have reference to guild.
CachelessTextChannel
CachelessTextChannel represents single text channel on Guild. Inhertits from MessageChannel and mixes CacheGuildChannel.
CachelessVoiceChannel
CacheMember
A user with Guild context.
CacheTextChannel
CachelessTextChannel represents single text channel on Guild. Inhertits from MessageChannel and mixes CacheGuildChannel.
CacheVoiceChannel
Represents VoiceChannel within Guild
CategoryChannel
Represents guild group channel.
ChangeKeyType
Type of change in audit log
Channel
A channel. Abstract base class that defines the base methods and/or properties for all Discord channel types.
ChannelBuilder
Builder for creating mini channel instance
ChannelCache
Cache for Channels
ChannelCreateEvent
Sent when a channel is created.
ChannelDeleteEvent
Sent when a channel is deleted.
ChannelPinsUpdateEvent
Fired when channel"s pinned messages are updated
ChannelType
Enum for possible channel types
ChannelUpdateEvent
Sent when a channel is updated.
ClientOAuth2Application
The client's OAuth2 app, if the client is a bot.
ClientOptions
Optional client settings which can be used when creating new instance of client. It allows to tune up client to your needs.
ClientStatus
Provides status of user on different devices
ClientUser
ClientUser is bot's discord account. Allows to change bot's presence.
Constants
The client constants.
Convertable<T>
Specifies objects which can be converted to Builder
DisconnectEvent
Sent when a shard disconnects from the websocket.
DisconnectEventReason
Reason why shard was disconnected.
DiscordColor
Wrapper for colors. Simplifies creation and provides interface to interact with colors for nyxx.
Disposable
Provides abstraction for disposing object's resources when isn't needed anymore
DMChannel
Represents channel with another user.
DMMessage
Message that is sent in dm channel or group dm channel
DummyTextChannel
Embed
A message embed. Can contain null elements.
EmbedAuthor
Author of embed. Can contain null elements.
EmbedAuthorBuilder
Build new instance of author which can be used in EmbedBuilder
EmbedBuilder
Builds up embed object.
EmbedField
Single instance of Embed's field. Can contain null elements.
EmbedFieldBuilder
Builder for embed Field.
EmbedFooter
Embed's footer. Can contain null elements.
EmbedFooterBuilder
Build new instance of Embed's footer
EmbedProvider
A message embed provider.
EmbedThumbnail
A message embed thumbnail.
EmbedVideo
Video attached to embed. Can contain null elements.
Emoji
Represents emoji. Subclasses provides abstraction to custom emojis(like GuildEmoji).
GameAssets
Presence"s assets
GameSecrets
Represents presence"s secrets
GatewayIntents
When identifying to the gateway, you can specify an intents parameter which allows you to conditionally subscribe to pre-defined "intents", groups of events defined by Discord. If you do not specify a certain intent, you will not receive any of the gateway events that are batched into that group. Reference
GroupDMChannel
Represents group DM channel.
Guild
Guild object represents single Discord Server. Guilds are a collection of members, channels, and roles that represents one community. [...]
GuildBanAddEvent
Sent when a member is banned.
GuildBanRemoveEvent
Sent when a user is unbanned from a guild.
GuildBuilder
Allows to build guild object for creating new one or modifying existing
GuildCreateEvent
Sent when the bot joins a guild.
GuildDeleteEvent
Sent when you leave a guild.
GuildEmoji
Emoji object. Handles Unicode emojis and custom ones. Always check if object is partial via partial field before accessing fields or methods, due any of field can be null or empty
GuildEmojisUpdateEvent
Fired when emojis are updated
GuildEntity
Represents entity which bound to guild, eg. member, emoji, message, role.
GuildFeature
Guild features
GuildMemberAddEvent
Sent when a member joins a guild.
GuildMemberRemoveEvent
Sent when a user leaves a guild, can be a leave, kick, or ban.
GuildMemberUpdateEvent
Sent when a member is updated.
GuildMessage
Message that is sent in guild channel
GuildPreview
Returns guild even if the user is not in the guild. This endpoint is only for Public guilds.
GuildTextChannel
ITextChannel in context of Guild.
GuildUpdateEvent
Sent when a guild is updated.
HttpErrorEvent
Sent when a failed HTTP response is received.
HttpResponseError
Returned when client fails to execute http request. Will contain reason why request failed.
HttpResponseEvent
Sent when a successful HTTP response is received.
HttpResponseSuccess
Returned when http request is successfully executed.
IEnum<T>
Abstract interface for enums in library
IGuildChannel
Represents channel which is part of guild. Can be represented by CachelessGuildChannel or CacheGuildChannel
IGuildEmoji
IMember
Represents Guild member. Can be either CachelessMember or CacheMember depending on client config and cache state. Interface allows basic operations on member but does not guarantee data to be valid or available
IMessageAuthor
Could be either User, CacheMember or Webhook. Webhook will have most of field missing.
Invite
Represents invite to guild.
InviteCreatedEvent
Emitted when invite is creating
InviteDeletedEvent
Emitted when invite is deleted
InviteWithMeta
Invite object with additional metadata
IRole
Represents Guild role. Interface allows basic operations on member but does not guarantee data to be valid or available
ISend
Marks entity to which message can be sent
ITextChannel
Represents text channel. Can be either CachelessTextChannel or DMChannel or GroupDMChannel
MemberChunkEvent
Sent in response to GUILD_REQUENT_MEMBERS websocket command. You can use the chunk_index and chunk_count to calculate how many chunks are left for your request.
Mentionable
Provides abstraction for entities which can be mentioned
Message
Message class represents single message. It contains it"s Event Streams. Message among all it is properties has also back-reference to MessageChannel from which it was sent, Guild and User properties which are associated with this message.
MessageBuilder
Allows to create pre built custom messages which can be passed to classes which inherits from ISend.
MessageCache
Cache for messages. Provides few utilities methods to facilitate interaction with messages. []= operator throws - use put() instead.
MessageChannel
Provides abstraction of messages for CachelessTextChannel, DMChannel and GroupDMChannel. Implements iterator which allows to use message object in for loops to access messages sequentially. [...]
MessageDecoration
Specifies formatting of String appended with MessageBuilder
MessageDeleteBulkEvent
Emitted when multiple messages are deleted at once.
MessageDeleteEvent
Sent when a message is deleted.
MessageEditBuilder
Message builder for editing messages.
MessageFlags
Extra features of the message
MessageReactionAddedEvent
Emitted when reaction is add to message
MessageReactionEvent
Emitted when reaction is added or removed from message
MessageReactionRemovedEvent
Emitted when reaction is removed from message
MessageReactionRemoveEmojiEvent
Emitted when reactions of certain emoji are deleted
MessageReactionsRemovedEvent
Emitted when all reaction are removed
MessageReceivedEvent
Sent when a new message is received.
MessageReference
Reference data to cross posted message
MessageType
Represents messgae type
MessageUpdateEvent
Sent when a message is updated.
MultipartRequest
Request with which files will be sent. Cannot contain request body.
NitroType
Premium types denote the level of premium a user has.
Nyxx
The main place to start with interacting with the Discord API and creating discord bot. From there you can subscribe to various Streams to listen to Events and fetch data from API with provided methods or get cached data. [...]
OAuth2Application
An OAuth2 application.
OAuth2Guild
A mini guild object with permissions for OAuth2Info.
OAuth2Info
Info about a OAuth2 app, bot, user, and possible guilds that that bot can be invited to.
OPCodes
Gateway constants
PartialGuildEmoji
PermissionOverrideBuilder
Builder for manipulating PermissionsOverrides. Created from existing override or manually by passing type and id of enttiy.
Permissions
Permissions for a role or channel override.
PermissionsBuilder
Builder for permissions.
PermissionsConstants
Permissions constants
PermissionsOverrides
Holds permissions overrides for channel
PermissionsUtils
Util function for manipulating permissions
PremiumTier
Boost level of guild
PresenceBuilder
Allows to build object of user presence used later when setting user presence.
PresenceUpdateEvent
Sent when a member's presence updates.
RatelimitEvent
Sent when the client is rate limit ed, either by the rate limit handler itself, or when a 429 is received.
Reaction
Reaction object. emoji field can be partial GuildEmoji.
ReadyEvent
Sent when the client is ready.
Role
Represents a Discord guild role, which is used to assign priority, permissions, and a color to guild members
RoleBuilder
Creates role
RoleCreateEvent
Sent when a role is created.
RoleDeleteEvent
Sent when a role is deleted.
RoleTags
Additional Role role tags which hold optional data about role
RoleUpdateEvent
Sent when a role is updated.
Shard
ShardManager
Spawns, connects, monitors, manages and terminates shards. Sharding will be automatic if no user settings are supplied in ClientOptions when instantiating Nyxx client instance. [...]
Snowflake
Snowflake represents id system used by Discord. id property is actual id of entity which holds Snowflake.
SnowflakeEntity
Marks a snowflake entity. Snowflake entities are ones that have an id that uniquely identifies them. Includes only actual id of entity and createdAt which is timestamp when entity was created.
TypingEvent
Sent when a user starts typing.
UnicodeEmoji
Represents unicode emoji. Contains only emoji code.
User
Represents a single user of Discord, either a human or a bot, outside of any specific guild's context.
UserFlags
Additional flags associated with user account. Describes if user has certain features like joined into one of houses or is discord employee.
UserStatus
Provides values for user status.
UserUpdateEvent
Emitted when user was updated
Utils
Collection of misc util functions
VoiceChannel
VoiceRegion
Represents voice region on which discord guild takes place
VoiceServerUpdateEvent
Emitted when guild's voice server changes
VoiceState
Used to represent a user"s voice connection status. If channel is null, it means that user left channel.
VoiceStateUpdateEvent
Emitted when client connects/disconnects/mutes etc to voice channel
Webhook
Webhooks are a low-effort way to post messages to channels in Discord. They do not require a bot user or authentication to use.
WebhookType
Type of webhook. Either incoming if it its normal webhook executable with token, or channelFollower if its discord internal webhook

Extensions

IntExtensions
Extension on int
StringExtensions
Extension on int

Exceptions / Errors

EmbedBuilderArgumentException
Thrown when embed doesnt meet requirements to be valid
InvalidShardException
Thrown when operation is unsupported due invalid or wrong shard being accessed.
InvalidSnowflakeException
Thrown when cannot convert provided data to Snowflake
MissingTokenError
Thrown when token is empty or null