-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c18a053
commit b0f5b69
Showing
29 changed files
with
489 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,30 @@ | ||
/// Extensions and additional utilities for working with [nyxx](https://pub.dev/packages/nyxx). | ||
library nyxx_extensions; | ||
|
||
export 'src/channel.dart'; | ||
export 'src/date_time.dart'; | ||
export 'src/embed_builder.dart'; | ||
export 'src/emoji.dart'; | ||
export 'src/guild.dart'; | ||
export 'src/message.dart'; | ||
export 'src/pagination.dart'; | ||
export 'src/role.dart'; | ||
export 'src/sanitizer.dart'; | ||
export 'src/user.dart'; | ||
export 'src/utils/emoji.dart'; | ||
export 'src/utils/endpoint_paginator.dart' hide streamPaginatedEndpoint; | ||
export 'src/utils/formatters.dart'; | ||
export 'src/permissions.dart'; | ||
export 'src/endpoint_paginator.dart'; | ||
export 'src/utils/pagination.dart'; | ||
export 'src/utils/permissions.dart'; | ||
export 'src/utils/sanitizer.dart'; | ||
|
||
export 'src/extensions/channel.dart'; | ||
export 'src/extensions/client.dart'; | ||
export 'src/extensions/date_time.dart'; | ||
export 'src/extensions/embed.dart'; | ||
export 'src/extensions/emoji.dart'; | ||
export 'src/extensions/guild.dart'; | ||
export 'src/extensions/managers/audit_log_manager.dart'; | ||
export 'src/extensions/managers/channel_manager.dart'; | ||
export 'src/extensions/managers/entitlement_manager.dart'; | ||
export 'src/extensions/managers/guild_manager.dart'; | ||
export 'src/extensions/managers/member_manager.dart'; | ||
export 'src/extensions/managers/message_manager.dart'; | ||
export 'src/extensions/managers/scheduled_event_manager.dart'; | ||
export 'src/extensions/managers/user_manager.dart'; | ||
export 'src/extensions/member.dart'; | ||
export 'src/extensions/message.dart'; | ||
export 'src/extensions/role.dart'; | ||
export 'src/extensions/scheduled_event.dart'; | ||
export 'src/extensions/snowflake_entity.dart'; | ||
export 'src/extensions/user.dart'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:nyxx/nyxx.dart'; | ||
import 'package:nyxx_extensions/src/extensions/managers/channel_manager.dart'; | ||
import 'package:nyxx_extensions/src/utils/formatters.dart'; | ||
import 'package:nyxx_extensions/src/utils/permissions.dart'; | ||
|
||
/// Extensions on [PartialChannel]s. | ||
extension PartialChannelExtensions on PartialChannel { | ||
/// A mention of this channel. | ||
String get mention => channelMention(id); | ||
} | ||
|
||
/// Extensions on [Channel]s. | ||
extension ChannelExtensions on Channel { | ||
/// A URL clients can visit to navigate to this channel. | ||
Uri get url => Uri.https(manager.client.apiOptions.host, '/channels/${this is GuildChannel ? '${(this as GuildChannel).guildId}' : '@me'}/$id'); | ||
} | ||
|
||
/// Extensions on [GuildChannel]s. | ||
extension GuildChannelExtensions on GuildChannel { | ||
/// Compute [member]'s permissions in this channel. | ||
/// | ||
/// {@macro compute_permissions_detail} | ||
Future<Permissions> computePermissionsFor(PartialMember member) async => await computePermissions(this, await member.get()); | ||
} | ||
|
||
/// Extensions on [Thread]s. | ||
extension ThreadExtensions on Thread { | ||
/// Same as [listThreadMembers], but has no limit on the number of members returned. | ||
/// | ||
/// {@macro paginated_endpoint_streaming_parameters} | ||
Stream<ThreadMember> streamThreadMembers({bool? withMembers, Snowflake? after, Snowflake? before, int? pageSize}) => | ||
manager.streamThreadMembers(id, withMembers: withMembers, after: after, before: before, pageSize: pageSize); | ||
} |
Oops, something went wrong.