RestClientOptions constructor

const RestClientOptions({
  1. List<NyxxPlugin<Nyxx>> plugins = const [],
  2. String loggerName = 'Nyxx',
  3. Duration? rateLimitWarningThreshold = const Duration(seconds: 10),
  4. CacheConfig<User> userCacheConfig = _smallCacheConfig,
  5. CacheConfig<Channel> channelCacheConfig = _defaultCacheConfig,
  6. CacheConfig<Message> messageCacheConfig = _smallCacheConfig,
  7. CacheConfig<Webhook> webhookCacheConfig = _defaultCacheConfig,
  8. CacheConfig<Guild> guildCacheConfig = _defaultCacheConfig,
  9. CacheConfig<Member> memberCacheConfig = _smallCacheConfig,
  10. CacheConfig<Role> roleCacheConfig = _defaultCacheConfig,
  11. CacheConfig<Emoji> emojiCacheConfig = _smallCacheConfig,
  12. CacheConfig<GuildSticker> stickerCacheConfig = _smallCacheConfig,
  13. CacheConfig<GlobalSticker> globalStickerCacheConfig = _defaultCacheConfig,
  14. CacheConfig<StageInstance> stageInstanceCacheConfig = _defaultCacheConfig,
  15. CacheConfig<ScheduledEvent> scheduledEventCacheConfig = _smallCacheConfig,
  16. CacheConfig<AutoModerationRule> autoModerationRuleConfig = _smallCacheConfig,
  17. CacheConfig<Integration> integrationConfig = _smallCacheConfig,
  18. CacheConfig<AuditLogEntry> auditLogEntryConfig = _smallCacheConfig,
  19. CacheConfig<VoiceState> voiceStateConfig = _smallCacheConfig,
  20. CacheConfig<ApplicationCommand> applicationCommandConfig = _defaultCacheConfig,
  21. CacheConfig<CommandPermissions> commandPermissionsConfig = _smallCacheConfig,
  22. CacheConfig<Entitlement> entitlementConfig = _defaultCacheConfig,
  23. CacheConfig<Sku> skuConfig = _defaultCacheConfig,
  24. CacheConfig<Subscription> subscriptionConfig = _defaultCacheConfig,
  25. CacheConfig<SoundboardSound> globalSoundboardCacheConfig = _smallCacheConfig,
  26. CacheConfig<SoundboardSound> soundboardCacheConfig = _smallCacheConfig,
})

Create a new RestClientOptions.

Implementation

const RestClientOptions({
  super.plugins,
  super.loggerName,
  super.rateLimitWarningThreshold,
  // Users are generally not needed over long periods of time; use a small
  // cache.
  this.userCacheConfig = _smallCacheConfig,
  this.channelCacheConfig = _defaultCacheConfig,
  // Messages are generally not needed over long periods of time and are
  // cached per channel anyway; use a small cache.
  this.messageCacheConfig = _smallCacheConfig,
  this.webhookCacheConfig = _defaultCacheConfig,
  this.guildCacheConfig = _defaultCacheConfig,
  // Members are generally not needed over long periods of time and are
  // cached per guild anyway; use a small cache.
  this.memberCacheConfig = _smallCacheConfig,
  // Guilds tend not to have a large amount of roles (relatively speaking),
  // but we also want to access all of a guild's roles during e.g permission
  // calculations; use a larger cache.
  this.roleCacheConfig = _defaultCacheConfig,
  // Bots don't tend to use emoji or sticker data. Don't bother caching too
  // many.
  this.emojiCacheConfig = _smallCacheConfig,
  this.stickerCacheConfig = _smallCacheConfig,
  // ...but there are not too many global stickers, and they are the most
  // used, so use a larger cache for these.
  this.globalStickerCacheConfig = _defaultCacheConfig,
  this.stageInstanceCacheConfig = _defaultCacheConfig,
  this.scheduledEventCacheConfig = _smallCacheConfig,
  this.autoModerationRuleConfig = _smallCacheConfig,
  this.integrationConfig = _smallCacheConfig,
  this.auditLogEntryConfig = _smallCacheConfig,
  // Voice states are saved per guild, so we don't need to store large amount
  // of them at a time.
  this.voiceStateConfig = _smallCacheConfig,
  this.applicationCommandConfig = _defaultCacheConfig,
  this.commandPermissionsConfig = _smallCacheConfig,
  this.entitlementConfig = _defaultCacheConfig,
  this.skuConfig = _defaultCacheConfig,
  this.subscriptionConfig = _defaultCacheConfig,
  this.globalSoundboardCacheConfig = _smallCacheConfig,
  this.soundboardCacheConfig = _smallCacheConfig,
});