[ci skip]
This commit is contained in:
Szymon Uglis 2020-11-17 17:11:55 +01:00 committed by Szymon Uglis
parent 8d0fde9789
commit 6b92339e80
No known key found for this signature in database
GPG key ID: 112376C5BEE91FE2
2 changed files with 13 additions and 3 deletions

View file

@ -1,8 +1,18 @@
part of nyxx;
/// Options for configuring cache. Allows to specify where and which entities should be cached and preserved in cache
class CacheOptions {
/// Defines in which locations members will be cached
CachePolicyLocation memberCachePolicyLocation = CachePolicyLocation();
/// Defines which members are preserved in cache
CachePolicy<Member> memberCachePolicy = MemberCachePolicy.def;
/// Defines where channel entities are preserved cache. Defaults to [CachePolicyLocation] with additional objectConstructor set to true
CachePolicyLocation channelCachePolicyLocation = CachePolicyLocation()..objectConstructor = true;
/// Defines which channel entities are preserved in cache.
CachePolicy<IChannel> channelCachePolicy = ChannelCachePolicy.def;
}
/// Optional client settings which can be used when creating new instance

View file

@ -93,7 +93,7 @@ class Shard implements Disposable {
throw InvalidShardException._new("Cannot request member for guild on wrong shard");
}
guildPayload = guild.toString();
guildPayload = [guild.toString()];
} else if (guild is Iterable<Snowflake>) {
if(!this.guilds.any((element) => guild.contains(element))) {
throw InvalidShardException._new("Cannot request member for guild on wrong shard");
@ -106,10 +106,10 @@ class Shard implements Disposable {
final payload = <String, dynamic>{
"guild_id": guildPayload,
if (query != null) "query": query,
if (userIds != null) "user_ids": userIds.map((e) => e.toString()).toList(),
"limit": limit,
"presences": presences,
if (query != null) "query": query,
if (userIds != null) "user_ids": userIds.map((e) => e.toString()).toList(),
if (nonce != null) "nonce": nonce
};